unite 1 challenge 2

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Identify the line of code that would generate an error in the following CREATE TABLE statement. This statement creates a table called 'Users' that consists of the user_id as the primary key, the username, and the password. CREATE TABLE user user_id int PRIMARY KEY, username VARCHAR (50), password VARCHAR (50) ); a.) 1 b.) 2 c.) 3 d.) 4

a.)1

Identify the line of code that would either generate a syntax, logical, or requirements error in the following CREATE TABLE statement. The statement should create a table called users that consists of the user_id as the primary key that is auto-incremented, the username, and the password. CREATE TABLE users( user_id int PRIMARY KEY, username VARCHAR (50), password VARCHAR (50) ); a.) 2 b.) 3 c.) 1 d.) 4

a.)2

Identify the line of code that would generate an error in the following CREATE TABLE statement. This statement creates a table called 'Company' that consists of the company_id as the primary key, the company_name, and address. CREATE TABLE company( company_id INT PRIMARY KEY company_name VARCHAR (100), address VARCHAR (100) ); a.) 2 b.) 4 c.) 3 d.) 1

a.)2

Identify the line of code that would either generate a syntax, logical, or requirements error in the following CREATE TABLE statement. The statement should create a table called 'Employee' that consists of the employee_id as the primary key that is auto-incremented, the first_name, and last_name. CREATE TABLE employee employee_id serial PRIMARY KEY, first_name VARCHAR (50), last_name VARCHAR (50) ); a.) 3 b.) 1 c.) 4 d.) 2

b.)1

Identify the line of code that would either generate a syntax, logical, or requirements error in the following CREATE TABLE statement. The statement should create a table called 'Company' that consists of the company_id as the primary key that is auto-incremented, the company_name, and address. CREATE TABLE company( company_id serial PRIMARY KEY, company_name int, address VARCHAR (100) ); a.) 1 b.) 3 c.) 2 d.) 4

b.)3

Select the correctly constructed CHECK constraint to validate the cost column of type int to ensure that values placed into it are at least 0 and below or equal to 1000. a.)CHECK (cost >= 0 OR cost <= 1000) b.)CHECK (cost >= 0 AND cost <= 1000) c.)CHECK (cost <= 0 AND cost >= 1000) d.)CHECK (cost > 0 AND cost < 1000)

b.)CHECK (cost >= 0 AND cost <= 1000)

Which of these constraints ensures that the column cannot be empty? a.)FOREIGN KEY b.)NOT NULL c.)UNIQUE d.)NOT EMPTY

b.)NOT NULL

Which of these constraints can be used to verify that the data is in a specific range? a.)FOREIGN KEY b.)PRIMARY KEY c.)CHECK d.)UNIQUE

c.)CHECK

Select the correctly constructed CHECK constraint to validate the total column of type int to ensure that values placed into it are greater or equal to 0. a.)CHECK (total > 0) b.)CHECK (total column > 0) c.)CHECK (total >= 0) d.)CHECK (total > -1)

c.)CHECK (total >= 0)

Which of these constraints ensures that all values in a column are different and cannot be empty? a.)NOT NULL b.)UNIQUE c.)PRIMARY KEY d.)FOREIGN KEY

c.)PRIMARY KEY

Identify the line of code that would generate an error in the following CREATE TABLE statement. This statement creates a table called 'Company' that consists of the company_id as the primary key, the company_name and address. CREATE TABLE company( company_id INT PRIMARY KEY, company_name VARCHAR,address VARCHAR (100) ); a.)1 b.)2 c.)4 d.)3

d.)3

Select the correctly constructed CHECK constraint to validate the total column of type int to ensure that values placed into it are greater than 0. a.)CHECK (total > -1) b.)CHECK (total column > 0) c.)CHECK (total >= 0) d.)CHECK (total > 0)

d.)CHECK (total > 0)


Kaugnay na mga set ng pag-aaral

NURS 321 Practice Questions for Renal/GU Quiz

View Set

Chapter 23: Integumentary Problems

View Set

MasteringAandP: Chapter 03 Homework

View Set

Management SkillsMidterm Study Guide

View Set

Honors Bio II Test Review: Chapters 4 & 5

View Set