//if you have any query then comment below.please rate the answer
Answer:-
1) false: the user needs to supply all field data to create the account
2) True: the stored procedure use only generated PID for the password
3) False: the order will be maintained in first the people table will insert then the password table, because it depends on the people table.
4) True:- here the procudure assuming that the email field in people table in UNIQUE.
CREATE PROCEDURE createAccount IN inputFirst VARCHAR(40) IN inputLast VARCHAR(40) IN inputEmail VARCHAR(40) IN inputPassword VARCHAR(40) BEGIN...
Need help modifing the below ap_equipment_insert_3 stored procedure to use the bebug argument properly and to add an output clause on the insert near the bottom. alter Procedure ap_Equipment_Insert_3 -- Store values in equipment table. -- Return identifier of the record to the caller. ( @chvMake varchar(50), @chvModel varchar(50), @chvEqType varchar(30) ) As declare @intEqTypeId int, @ErrorCode int, @intEqId int -- does such eqType already exist in the database If Not Exists (Select...
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)...
Use an INSERT INTO statement with a subquery containing a SQL string function to create user names for the volunteers based on their legal names and insert them into the table. +----------------------+ | Tables_in_volunteers | +----------------------+ | address | | email | | funds | | hours | | person | | phone | | users | +----------------------+ users legal names are in the address table user table is : CREATE TABLE USERS(volunteer_id INT NOT NULL, username VARCHAR(50), PRIMARY KEY...
--Create procedure for GetPartNums in SQL --GetPartNums- retrieve all part nums from the database --Database if db_id('TestPremierProducts') is not null begin use master alter database TestPremierProducts set SINGLE_USER with rollback immediate drop database TestPremierProducts end create database TestPremierProducts go USE TestPremierProducts; go /* create the tables */ CREATE TABLE Rep (RepNum int Identity(1,1), LastName VARCHAR(15), FirstName VARCHAR(15), Street VARCHAR(15), City VARCHAR(15), State VARCHAR(2), Zip VARCHAR(5), Commission MONEY, Rate DECIMAL(3,2), PRIMARY KEY (RepNum)); go CREATE TABLE Customer (CustomerNum int Identity(1,1) PRIMARY...
--- Paper Review drop table paper_review cascade constraint; drop table paper_author cascade constraint; drop table paper cascade constraints; drop table author cascade constraints; drop table reviewer cascade constraints; create table reviewer ( rid int, --- reviewer id rname varchar(50), --- reviewer name remail varchar(50),-- reviewer email raffiliation varchar(50),-- reviewer affiliation primary key (rid) ); insert into reviewer values(1,'Alex Golden', 'golden@umbc.com','UMBC'); insert into reviewer values(2,'Ann Stonebraker', 'ann@umd.edu','UMD'); insert into reviewer values(3,'Karen Smith', 'karen@umb.com','UMB'); insert into reviewer values(4,'Richard Wallas', 'richard@umbc.edu','UMBC'); insert into...
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)...
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...
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,...
Use the SQL statements provided to create your tables. Write one
SQL statement for each of the following problems. You can only use
the conditions listed in the tasks. E.g., in task 1, you cannot
manually look up pid of Information Systems undergraduate
program.
Here is the given code:
drop table textbook_schedule cascade constraints;
drop table textbook_author cascade constraints;
drop table schedule cascade constraints;
drop table course cascade constraints;
drop table textbook cascade constraints;
drop table author cascade constraints;
drop...
Assume the following employees.sql file: create table employees ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT NOT NULL, first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(50), age INT, gender VARCHAR(50), company VARCHAR(50) ); insert into employees (id, first_name, last_name, email, age, gender, company) values (1, 'Nicolas', 'Skeates', 'nskeates0@zdnet.com', 50, 'Male', 'Kwinu'); insert into employees (id, first_name, last_name, email, age, gender, company) values (2, 'Valentijn', 'Digwood', 'vdigwood1@washingtonpost.com', 40, 'Male', 'Yabox'); insert into employees (id, first_name, last_name,...