Git Product home page Git Product logo

sql.buildanddestroy's Introduction

Build and Destroy: Introductory SQL Queries

COMPLETED LAB Given the scenarios, add the directed queries to the "answers" directory's files.

Creating databases COMPLETED

Write the correct SQL statement to create a new database called myNewDB. DONE

(Add your query to the file exercise1.sql) DONE

Deleting databases`COMPLETE

Write the correct SQL statement to delete a database named myNewDB. DONE

(Add your query to the file exercise2.sql) DONE

Creating tables COMPLETED

Write the correct SQL statement to create a new table called Users, DONE with an int field called UserID, DONE and the following varchar fields of size 255: LastName, FirstName, Address, City DONE

(Add your query to the file exercise3.sql) DONE

Deleting tables COMPLETED

Write the correct SQL statement to delete a table called Users. SONE

(Add your query to the file exercise4.sql) DONE

Use the TRUNCATE statement to delete all data inside the Users table. DONE

(Add your query to the file exercise5.sql) DONE

Altering tables COMPLETED

Add a column of type DATE called Birthday to the Users table. DONE

(Add your query to the file exercise6.sql) DONE

Delete the column Birthday from the Users DONE

(Add your query to the file exercise7.sql) DONE

Inserting records COMPLETED

Insert a new record in the Students table.A DONE

Schema:

StudentName,
Address, 
City, 
PostalCode,
Country

Record's info to enter: DONE

Jane Doe
57 Union St
Glasgow, Scotland
G13RB

(Add your query to the file exercise8.sql) DONE

Selecting Records COMPLETED

Where

Use the NOT keyword to select all records in the Students table where City is NOT "Philadelphia". DONE

(Add your query to the file exercise9.sql) DONE

Select all records in the Students table where the City column has the value 'Philadelphia' or 'Trenton'. DONE

(Add your query to the file exercise10.sql) DONE

Order By COMPLETED

Select all records from the Students table, sort the result alphabetically by the column City. DONE

(Add your query to the file exercise11.sql) DONE

Select all records from the Students table, sort the result reversed alphabetically by the column City. DONE

(Add your query to the file exercise12.sql) DONE

Select all records from the Students table, sort the result alphabetically, first by the column Country, then by the column City. DONE

(Add your query to the file exercise13.sql) DONE

Null values

Select all records from the Students where the PostalCode column is empty.DONE

(Add your query to the file exercise14.sql) DONE

Select all records from the Students where the PostalCode column is NOT empty. DONE

(Add your query to the file exercise15.sql) DONE

Updating records CONPLETED

Update the City column of all records in the Students table and set it to "Edinburgh". DONE

(Add your query to the file exercise16.sql) DONE

Set the value of the City columns to "Edinburgh", but only the ones where the Country column has the value "Scotland". DONE

(Add your query to the file exercise17.sql) DONE

Update the City value and the Country value to "Edinburgh", "Scotland" in the Students table, for the Student whose ID is 35. DONE

(Add your query to the file exercise18.sql) DONE

Deleting Records

Delete all the records from the Students table where the Country value is "Scotland". DONE

(Add your query to the file exercise19.sql) DONE

Delete all the records from the Students table. DONE

(Add your query to the file exercise20.sql) DONE

sql.buildanddestroy's People

Contributors

lloydjr avatar thesleuth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.