5. Based on below descriptions, write SQL queries statement to answer the following questions. Column Key Type Nulls Foreign Key Name Table Primary Key NID Fname Lname Pid No Patient Foreign Key Column Pid Data Length int 7 varchar 25 varchar 25 int 7

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter3: Creating Tables
Section: Chapter Questions
Problem 1CAT
icon
Related questions
icon
Concept explainers
Question
5. Based on below descriptions, write SQL queries statement to answer the following
questions.
Column Key Type Nulls Foreign Key
Name
Table
Primary Key
NID
Fname
Lname
Pid
No
Patient
Foreign Key
Column
Pid
a) Create a new table called Nurse based on the information given.
Data
Length
int
7
varchar 25
varchar 25
int
7
b) Change the field length of last name to VARCHAR (30) in the NURSE table
c) Add an age column in between LNAME and PID in the NURSE table. This column
only allows integer data to be entered with maximum 2 digit.
d) Rename column FNAME to FirstName in the NURSE table. This column only allows
variable character data to be entered with maximum 30 character.
Transcribed Image Text:5. Based on below descriptions, write SQL queries statement to answer the following questions. Column Key Type Nulls Foreign Key Name Table Primary Key NID Fname Lname Pid No Patient Foreign Key Column Pid a) Create a new table called Nurse based on the information given. Data Length int 7 varchar 25 varchar 25 int 7 b) Change the field length of last name to VARCHAR (30) in the NURSE table c) Add an age column in between LNAME and PID in the NURSE table. This column only allows integer data to be entered with maximum 2 digit. d) Rename column FNAME to FirstName in the NURSE table. This column only allows variable character data to be entered with maximum 30 character.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning