PRELIM Quiz 1 Lab Flashcards

1
Q

Provide the SQL command that will create a database named dbexam.

A

CREATE DATABASE dbexam;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Provide the command that lists all existing databases.

A

SHOW DATABASES;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Command that list all existing tables.

A

show tables;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The command that deletes a table named tblEmployee.

A

DROP TABLE tblEmployee;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The command that selects all the records in the “tblEmployee” table.

A

SELECT * FROM tblEmployee;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The command that creates a table named tblEmployee with the following details:

lname - varchar(50)

fname - varchar(50)

city - varchar(50)

A

CREATE TABLE tblEmployee(lname varchar(50), fname varchar(50), city varchar(50));

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The ______ parameter specifies the type of data the column can hold (e.g. varchar, integer, date, etc.).

A

datatype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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.

A

INSERT INTO tblPersons (PersonID, LastName, FirstName, Address, City) VALUES (1, ‘Manaloto’, ‘Mieko’, ‘Barcelona’, ‘City of San Fernando’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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.

A

INSERT INTO tblPersons (PersonID, LastName, City) VALUES (2, ‘Dizon’, ‘Angeles’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

(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.

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

(T ot F) SQL keywords are NOT case sensitive

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

(T ot F) The INSERT RECORD statement is used to insert new records in a table.

A

F
INSERT INTO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A field with a ___ value is a field with no value.

A

NULL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly