PRELIM Quiz 1 Lab Flashcards
Provide the SQL command that will create a database named dbexam.
CREATE DATABASE dbexam;
Provide the command that lists all existing databases.
SHOW DATABASES;
Command that list all existing tables.
show tables;
The command that deletes a table named tblEmployee.
DROP TABLE tblEmployee;
The command that selects all the records in the “tblEmployee” table.
SELECT * FROM tblEmployee;
The command that creates a table named tblEmployee with the following details:
lname - varchar(50)
fname - varchar(50)
city - varchar(50)
CREATE TABLE tblEmployee(lname varchar(50), fname varchar(50), city varchar(50));
The ______ parameter specifies the type of data the column can hold (e.g. varchar, integer, date, etc.).
datatype
The following command inserts a value in a table called “tblPersons” that contains five columns: PersonID, LastName, FirstName, Address, and City.
The PersonID column is of type int and will hold an integer and the value is 1.
The LastName, FirstName, Address, and City columns are of type varchar and will hold characters, and the maximum length for these fields is 255 characters. and the values are Manaloto, Mieko, Barcelona, City of San Fernando respectively.
INSERT INTO tblPersons (PersonID, LastName, FirstName, Address, City) VALUES (1, ‘Manaloto’, ‘Mieko’, ‘Barcelona’, ‘City of San Fernando’);
The following command inserts a value in a table called “tblPersons” that contains five columns: PersonID, LastName, FirstName, Address, and City.
The PersonID column is of type int and will hold an integer and the value is 2.
The LastName, FirstName, Address, and City columns are of type varchar and will hold characters, and the maximum length for these fields is 255 characters. and the values are Lastname - Dizon and City - Angeles.
INSERT INTO tblPersons (PersonID, LastName, City) VALUES (2, ‘Dizon’, ‘Angeles’);
(T ot F) If you are adding values for all the columns of the table, you do not need to specify the column names in the SQL query.
T
(T ot F) SQL keywords are NOT case sensitive
T
(T ot F) The INSERT RECORD statement is used to insert new records in a table.
F
INSERT INTO
A field with a ___ value is a field with no value.
NULL