Worksheetssql lab
Total questions: 20
Worksheet time: 10mins
How could we choose only unique values in a query?
SELECT UNIQUE
SELECT DISTINCT
SELECT SPECIAL
SELECT WITH NO DUPLICATE
What is the syntax to enter a new record into the "Sales" table?
INSERT INTO Sales VALUES
ALTER SALES NEW VALUES
SALES = SALES + NEW VALUES
SALES.ALTER.EDIT.CHANGE
What is the syntax to create a new table?
CREATE TABLE
MAKE TABLE
GENERATE TABLE
NEW TABLE
Which command is used for removing a table and all its data from the database:
Create command
Drop table command
Alter table command
All of the mentioned
SELECT * FROM Students WHERE Gender="Female" AND Class=2.2
would return how many records?
1
2
3
4
SELECT * FROM cars WHERE Doors > 3
would return how many records?
1
2
3
4
A primary key can be NULL in the table? TRUE or FALSE
TRUE
FALSE
What is a ‘tuple’?
A row or record in a database table
Another name for the key linking different tables in a database.
An attribute attached to a record.
Another name for a table in an RDBMS.
With SQL, how can you insert a new record into the "Persons" table?
INSERT ('Jimmy', 'Jackson') INTO Persons
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
A keyword that use in sql syntax that gives a temporary name in the table column?
US
AS
ALIASES
SQL SYNTAX
Records that generate the matching values in both table
Right join
Inner join
Cross join
Case Statement
What does SQL stand for?
Structured Query Language
Strong Question Language
Structured Question Language
Which SQL statement is used to extract data from a database?
SELECT
EXTRACT
GET
OPEN
With SQL, how do you select all the columns from a table named "Persons"?
SELECT * FROM Persons
SELECT *.Persons
SELECT Persons
SELECT [all] FROM Persons
What is the difference between WHERE and HAVING?
HAVING only applies to aggregate functions like GROUP BY
There are interchangeable
WHERE specifies a GEOGRAPHIC location for a database server
WHERE has limited use
Why make views?
It is faster, safer and better practice to not allow general access to the production database
You should not, they are slow
You should not, they are inefficient
"View" is simply a synonym for the return of the SELECT function
A database management system (DBMS) is a collection of programs that enables users to
create a database
manipulate a database
both create and manipulate a database
for storing data only
Data in a database is stored in a .......... .
Tables
Fields
single flat file
ORDER BY specifies ...................................
the criteria you need to find the information
the table(s) that contain(s) the information
the information you want to find within the database
how the data is organized (sorted) when it is retrieved.
The SQL DELETE statement has the following structure:
DELETE FROM
Table
WHERE
Condition
DELETE FROM
Table
WHERE
Record
DELETE FROM
Field
WHERE
Table
