The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 337 Weeks Ago, 6 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
I'm working on the following questions but I their something wrong with my coding?
can someone help me
4.Write the codeto createa new tableas shown below and createan indexon the Project_Namecolumn.
Table Name:Manager
|
ColumnName: |
ManagerID |
Manager_Name |
Project_ID |
Project_Name |
|
KeyType: |
PrimaryKey |
|
|
|
|
Null/Unique: |
Not Null |
|
Not Null |
Not Null |
|
FKTable: |
|
|
|
|
|
FKColumn: |
|
|
|
|
|
DataType: |
INTEGER |
VARCHAR |
INTEGER |
VARCHAR |
|
MaxLength: |
7 |
30 |
7 |
30 |
CREATE TABLE Manager (
ManagerID INT (7) NOT NULL,
Manager_Name VARCHAR (30),
Project_ID INT (7) NOT NULL,
Project_Name VARCHAR (30) NOT NULL,
PRIMARY KEY (ManagerID)
);
CREATE INDEX index_Project_Name ON Manager (Project_Name);
5.Write the codeto createan indexon the Project_IDcolumn of the Manager table.
CREATE INDEX index_Project_ID ON Manager (Project_ID);
6.Write the codeto removethe indexon the Project_Name column of the Manager table.
MYSQL:
ALTER TABLE Manager
Drop INDEX index_Project_Name;
SQL Server:
Drop INDEX Manager.index_Project_Name;
7.Write the codeto createa new tableas shown below and createasequenceon the Patient_ID column.
Table Name:Patient
|
ColumnName: |
Patient_ID |
P_Name |
|
|
|
KeyType: |
PrimaryKey |
|
|
|
|
Null/Unique: |
Not Null, Unique |
NOT NULL |
|
|
|
FKTable: |
|
|
|
|
|
FKColumn: |
|
|
|
|
|
DataType: |
INTEGER |
VARCHAR |
|
|
|
MaxLength: |
7 |
30 |
|
|
CREATE TABLE Patient (
Patient_ID INT (7) NOT NULL UNIQUE PRIMARY KEY,
P_Name VARCHAR (30) NOT NULL
);
CREATE INDEX index_Patient_ID ON Patient(Patient_ID);
Attachments:
----------- ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly