Question

Relation Students has schema: CREATE TABLE Students (     BannerID CHAR(9),     stuName VARCHAR(40) NOT NULL,...

Relation Students has schema:

CREATE TABLE Students (

    BannerID CHAR(9),

    stuName VARCHAR(40) NOT NULL,

    scholarship INT,

    PRIMARY KEY(BannerID));

The relation Students is currently empty. Develop a test that determines whether an insertion into Students is currently legal. Then apply your test to determine which of the following INSERT statements is allowable.            

a.

INSERT INTO Students VALUES(950111333, ’John Smith’, 1000);

b.

INSERT INTO Students (BannerID, stuName) VALUES(‘950111333’, ’John Smith’);

c.

INSERT INTO Students VALUES(‘950111222’, NOT NULL, 10000);

d.

INSERT INTO Students VALUES(‘950111444’, ’Ann Smith’, ’1000’);

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Option b is correct:

Explanation:

In a, bannerID is not char

In c, stuName should be varchar and not null is not varchar

In d,sscholarship is not int

So, b is correct

Add a comment
Know the answer?
Add Answer to:
Relation Students has schema: CREATE TABLE Students (     BannerID CHAR(9),     stuName VARCHAR(40) NOT NULL,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • SQL I have a database CREATE TABLE vendor ( vid CHAR(2) NOT NULL, vname VARCHAR(25) NOT...

    SQL I have a database CREATE TABLE vendor ( vid CHAR(2) NOT NULL, vname VARCHAR(25) NOT NULL, PRIMARY KEY (vid) ); CREATE TABLE category ( catid CHAR(2) NOT NULL, catname VARCHAR(25) NOT NULL, PRIMARY KEY (catid) ); CREATE TABLE product ( pid CHAR(3) NOT NULL, pname VARCHAR(25) NOT NULL, price NUMERIC (7,2) NOT NULL, vid CHAR(2) NOT NULL, categoryid CHAR(2) NOT NULL, PRIMARY KEY (pid)); CREATE TABLE region ( rid CHAR NOT NULL, rname VARCHAR(25) NOT NULL, PRIMARY KEY (rid)...

  • Database Management 6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL,...

    Database Management 6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL, address VARCHAR(60), UNIQUE (cust name, address)); A. Run the following inserts and explain why both work and how will you prevent it INSERT INTO customer VALUES ('Alex Doe', NULL); INSERT INTO customer VALUES ('Alex Doe', NULL); 7. [5] Modify the following table definition to ensure that all employees have a minimum wage of $10 CREATE TABLE employee ( empId INT PRIMARY KEY, empName VARCHAR(40)...

  • please answer 56789 CREATE TABLE ALLDRINKS(   /* All legal drinks */ DRINK       VARCHAR(30)   NOT NULL,  ...

    please answer 56789 CREATE TABLE ALLDRINKS(   /* All legal drinks */ DRINK       VARCHAR(30)   NOT NULL,   /* Drink name   */    CONSTRAINT DRINKNAME_PKEY PRIMARY KEY(DRINK) ); CREATE TABLE DRINKERS ( /* All drinkers */ DRINKER   VARCHAR(30)   NOT NULL,    CONSTRAINT DRINKERS_PKEY PRIMARY KEY (DRINKER)); CREATE TABLE LOCATED(   /* Pubs have locations */ PUB           VARCHAR(30)   NOT NULL,   /* Pub name   */ STREET       VARCHAR(30)   NOT NULL,   /* Street name   */ BLDG_NO       DECIMAL(4)   NOT NULL,   /* Building number   */...

  • CREATE TABLE DEPT ( DEPTNO INTEGER NOT NULL, DNAME VARCHAR(14), LOC VARCHAR(13), PRIMARY KEY (DEPTNO)); INSERT...

    CREATE TABLE DEPT ( DEPTNO INTEGER NOT NULL, DNAME VARCHAR(14), LOC VARCHAR(13), PRIMARY KEY (DEPTNO)); INSERT INTO DEPT VALUES (10,'SPORTS','NEW YORK'); INSERT INTO DEPT VALUES (20,'HOME','DALLAS'); INSERT INTO DEPT VALUES (30,'OUTDOOR','CHICAGO'); INSERT INTO DEPT VALUES (40,'CLOTHING','BOSTON'); CREATE TABLE EMP ( EMPNO INTEGER NOT NULL, ENAME VARCHAR(10), JOB VARCHAR(9), MGR INTEGER, SAL FLOAT, COMM FLOAT, DEPTNO INTEGER NOT NULL, FOREIGN KEY (DEPTNO) REFERENCES DEPT (DEPTNO), FOREIGN KEY (MGR) REFERENCES EMP(EMPNO), PRIMARY KEY (EMPNO)); INSERT INTO EMP VALUES (7839,'KING','PRESIDENT',NULL, 5000,NULL,10); INSERT INTO...

  • I need help with the following SQL query for a company database (script given below). The...

    I need help with the following SQL query for a company database (script given below). The name of the Department. The number of employees working in that department. The number of different projects controlled by this department. The name of the project controlled by this department that has the maximum number of employees of the company working on it. The number of the above project. The cumulative sum of the number of employees of the company working on the projects...

  • drop table department cascade constraints; create table department ( Dname   varchar2(15)   not null, Dnumber int   not...

    drop table department cascade constraints; create table department ( Dname   varchar2(15)   not null, Dnumber int   not null, Mgr_ssn   char(9)   not null, mgr_start_date   Date, primary key (Dnumber), Unique    (Dname)); insert into DEPARTMENT values ('Research', '5', '333445555', '22-May-1988'); insert into DEPARTMENT values ('Administration', '4', '987654321', '01-Jan-1995'); insert into DEPARTMENT values ('Headquarters', '1', '888665555', '19-Jun-1981'); drop table employee cascade constraints; create table employee ( Fname   varchar2(15) not null, Minit   char(1), Lname   varchar2(15) not null, Ssn   char(9), Bdate   date, Address   varchar2(30), Sex   char(1),...

  • Help please ASSIGNEMENT 1: Create table NATION along with following data: 40create table nation 41 (natcode char(3) not null 42 natname varchar (20) 43 exchrate decimal(9,5) 44 constraint pk natio...

    Help please ASSIGNEMENT 1: Create table NATION along with following data: 40create table nation 41 (natcode char(3) not null 42 natname varchar (20) 43 exchrate decimal(9,5) 44 constraint pk nation primary key (natcode))s 45 Add data into the table nation 46insert into nation values ('UK', 'United Kingdom',1) 47insert into nation values USA, 'United States',0.67) 48insert into nation values ('AUS,'Australia',0.46) 49insert into nation values (' IND,India',0.8228) DELIVERABLE 1: Screen shot evidence of the above table and data in MySQL workbench ASSIGNEMENT...

  • DROP TABLE EMPLOYEE; DROP TABLE JOB; DROP TABLE EMP; DROP TABLE EMP_1; DROP TABLE EMP_2; CREATE...

    DROP TABLE EMPLOYEE; DROP TABLE JOB; DROP TABLE EMP; DROP TABLE EMP_1; DROP TABLE EMP_2; CREATE TABLE JOB(JOB_CODE CHAR (3) PRIMARY KEY, JOB_DESCRIPTION VARCHAR (20) NOT NULL,JOB_CHG_HOUR NUMBER (5,2) NOT NULL,JOB_LAST_UPDATE DATE NOT NULL); INSERT INTO JOB VALUES('500','Programmer','35.75','20-Nov-2017'); INSERT INTO JOB VALUES('501','System Analyst','96.75','20-Nov-2017'); INSERT INTO JOB VALUES('502','Database Designer','125.00','24-Mar-2018'); CREATE TABLE EMPLOYEE(EMP_NUM CHAR (3) PRIMARY KEY,EMP_LNAME VARCHAR (15) NOT NULL,EMP_FNAME VARCHAR (15) NOT NULL, EMP_INITIAL CHAR (1),EMP_HIREDATE DATE NOT NULL,JOB_CODE CHAR (3), EMP_YEARS NUMBER (2),FOREIGN KEY (JOB_CODE) REFERENCES JOB (JOB_CODE)); INSERT...

  • Create three or more MySQL Data Control language (DCL) Statements using the Youth League Database. 1....

    Create three or more MySQL Data Control language (DCL) Statements using the Youth League Database. 1. A Create new user statement for the database 2. A statement that grants privileges to the new user 3. A statement that revokes privileges 1. A SQL Text File containing the SQL commands to create the database, create the table, and insert the sample test data into the table. 2. A SQL Text File containing the DCL SQL Statements. eted hemas Untitled Limit to...

  • 9 We want to find out the courses that each student is not enrolled in. Give a listing of the course descriptions, and the students (lname) who are not taking that specific course (Use a cartesi...

    9 We want to find out the courses that each student is not enrolled in. Give a listing of the course descriptions, and the students (lname) who are not taking that specific course (Use a cartesian product and union it with a minus) drop table student_class; drop table student; drop table class; create table student ( ssn char(11) not null, lname varchar(40) not null, fname varchar(20) not null, phone char(12), address varchar(40), city varchar(20), state char(2), zip char(5), dob date,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT