Filters
Question type

Study Flashcards

Which SQL command is used to view the data in a table?


A) VIEW
B) SELECT
C) SHOW
D) DISPLAY

E) All of the above
F) None of the above

Correct Answer

verifed

verified

Why does the POSTAL_CODE column in the REP table of the KimTay database have a data type of CHAR, if a postal code is made up of numbers?

Correct Answer

verifed

verified

Even though the POSTAL_CODE column contains numbers, those numbers are not used in calculations. Therefore, the column should have a CHAR data type.

What special value is used in SQL to represent cases in which an actual value is unknown, unavailable, or not applicable?


A) varchar
B) empty
C) not null
D) null

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

Which MySQL command do you use to define a table's structure by listing its columns, data types, and column lengths?


A) NEW TABLE
B) DEFINE TABLE
C) CREATE TABLE
D) ADD TABLE

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

When adding rows to character columns, make sure you enclose the values in single quotation marks.

A) True
B) False

Correct Answer

verifed

verified

True

In SQL Server, you can execute the sp_columns command to list all the columns in a table.

A) True
B) False

Correct Answer

verifed

verified

Laura is adding a new product to the CANDY table, which has columns for the product ID, name, description, and price. Price is a dollars and cents value; the others are strings of characters. Which SQL command should Laura use to add the row for the new product?


A) INSERT CANDY ROW (534, Cordial fudge, Dark chocolate fudge squares topped with a cherry swirl, 5.85) ;
B) INSERT VALUES ('534', 'Cordial fudge', 'Dark chocolate fudge squares topped with a cherry swirl', 5.85) INTO CANDY;
C) INSERT INTO CANDY VALUES (534, Cordial fudge, Dark chocolate fudge squares topped with a cherry swirl, 5.85) ;
D) INSERT INTO CANDY VALUES ('534', 'Cordial fudge', 'Dark chocolate fudge squares topped with a cherry swirl', 5.85) ;

E) C) and D)
F) A) and C)

Correct Answer

verifed

verified

A text file with a .sql extension that contains SQL commands is a _____.


A) command file
B) batch process
C) SQL plugin
D) script file

E) A) and C)
F) A) and D)

Correct Answer

verifed

verified

Pete would like to set up a database called BAKE_SALE_FUNDRAISER so that he can begin defining the objects within it. Which MySQL command should Pete use?


A) CREATE DATABASE: BAKE_SALE_FUNDRAISER
B) CREATE DATABASE BAKE_SALE_FUNDRAISER;
C) ACTIVATE DATABASE BAKE_SALE_FUNDRAISER;
D) ACTIVATE DATABASE: BAKE_SALE_FUNDRAISER

E) B) and C)
F) A) and B)

Correct Answer

verifed

verified

To list all the columns in a table and their properties in MySQL, use the LIST COLUMNS command.

A) True
B) False

Correct Answer

verifed

verified

Should a user be allowed to enter null values for the primary key?

Correct Answer

verifed

verified

No. The primary key should uni...

View Answer

Which of the following SQL commands changes the value in the column LAST_NAME within the row containing a REP_ID of 007?


A) UPDATE SALES_REP SET LAST_NAME = 'Bond' WHERE REP_ID = '007';
B) CHANGE SALES_REP LAST_NAME = 'Bond' WHERE REP_ID = '007';
C) REPLACE SALES_REP LAST_NAME = 'Bond' WHERE REP_ID = '007';
D) INSERT SALES_REP SET LAST_NAME = 'Bond' WHERE REP_ID = '007';

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

When creating a SQL table, _____.


A) add the NOT NULL clause for the columns that cannot contain null values
B) you must add PRIMARY KEY NOT NULL for the primary key column(s)
C) remember that the default behavior for table columns is to reject null values
D) include only those columns for which data will always be known and available

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

Which of the following is a valid name for a table?


A) TBL_1
B) 2_TBL
C) TBL 3
D) 4 tbl

E) B) and C)
F) None of the above

Correct Answer

verifed

verified

A

It is recommended that table names be limited to _____.


A) 12 characters
B) 14 characters
C) 24 characters
D) 30 characters

E) All of the above
F) A) and C)

Correct Answer

verifed

verified

Which data type should you use for columns that contain letters and special characters or numbers that will not be used in calculations?


A) CHAR
B) CHARACTER
C) TEXT
D) STRING

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

The DESCRIBE TABLE command defines a SQL table's structure by listing its columns, data types, and column lengths.

A) True
B) False

Correct Answer

verifed

verified

To display all the rows and columns in a table, type the word SELECT, followed by a(n) _____, followed by the keyword FROM and then the name of the table containing the data you want to view.


A) single quote
B) asterisk
C) double quote
D) slash

E) B) and D)
F) A) and D)

Correct Answer

verifed

verified

SQL was developed in the mid-____.


A) 1950s
B) 1970s
C) 1990s
D) 2000s

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

Jesse has written some commands in MySQL Workbench that he expects to run regularly, and he would like to save them for future use. What should he do next?


A) copy and paste the query into a .txt file
B) click on Query, then select Execute
C) click on File, then Save Script As
D) select a script from within his file system and click Open

E) A) and D)
F) B) and C)

Correct Answer

verifed

verified

Showing 1 - 20 of 35

Related Exams

Show Answer