SQL Create

6.Which statement will safely create a table only if it doesn’t already exist?
  • A. CREATE TABLE IF NOT EXISTS students (...);
  • B. CREATE OR REPLACE TABLE students (...);
  • C. IF NOT EXISTS CREATE TABLE students (...);
  • D. CREATE TABLE EXISTS students (...);

CREATE TABLE IF NOT EXISTS students (...);

CREATE TABLE IF NOT EXISTS students (...);

7.What does this SQL statement do?
CREATE TABLE books ( id INT PRIMARY KEY, title VARCHAR(100), price DECIMAL(5,2) );
  • A. Creates a new book
  • B. Creates a table with three columns and a primary key on id
  • C. Adds new columns to an existing table
  • D. Creates a database called books

Creates a table with three columns and a primary key on id

Creates a table with three columns and a primary key on id

8.Which command creates a new user-defined function in SQL?
  • A. CREATE FUNCTION
  • B. CREATE PROCEDURE
  • C. CREATE USER
  • D. CREATE TRIGGER

CREATE FUNCTION

CREATE FUNCTION

9.What keyword must follow CREATE to define a new database view?
  • A. TABLE
  • B. VIEW
  • C. INDEX
  • D. FUNCTION

VIEW

VIEW

10.Which of the following objects can be created using the CREATE statement in SQL?
  • A. Tables
  • B. Databases
  • C. Views
  • D. All of the above

All of the above

All of the above