SlideShare a Scribd company logo
use shop
create table customer
(
C_id int identity,
C_name nvarchar(20),
C_status nchar(5)
)
create table cust_status
(
Status_id int,
C_status_name nvarchar(20)
)
use shop
alter table customer
add primary key (C_id)
alter table customer
alter column C_status int
alter table cust_status
add primary key (Status_id)
alter table cust_status
alter column Status_id int not null
ALTER TABLE customer
ADD FOREIGN KEY (C_status)
REFERENCES cust_status(Status_id)
alter table customer
add gender nchar(2) not null
alter table customer
add constraint gender check (gender in ('er', 'em'))
alter table customer
add reg_date datetime not null
alter table customer
drop column reg_date
alter table customer
add reg_date datetime default getdate()
alter table customer
alter column reg_date nchar(10) set default ''

More Related Content

What's hot

array implementation
 array implementation array implementation
array implementation
Sathya Ds
 
Crash Course to SQL in PHP
Crash Course to SQL in PHPCrash Course to SQL in PHP
Crash Course to SQL in PHPwebhostingguy
 
Zen and the Art of Writing SQL Query
Zen and the Art of Writing SQL QueryZen and the Art of Writing SQL Query
Zen and the Art of Writing SQL Query
Plamen Ratchev
 
Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019
Laurent Destailleur
 
Sql lab experiments
Sql lab experimentsSql lab experiments
Sql lab experiments
LakshmiSarvani6
 
New Query Optimizer features in MariaDB 10.3
New Query Optimizer features in MariaDB 10.3New Query Optimizer features in MariaDB 10.3
New Query Optimizer features in MariaDB 10.3
Sergey Petrunya
 
Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functions
Vineeta Garg
 
Data Structures Lab
Data Structures LabData Structures Lab
Data Structures Lab
Neil Mathew
 
Oracle: Functions
Oracle: FunctionsOracle: Functions
Oracle: Functions
DataminingTools Inc
 
今10年経って〜思うことあれこれ〜 hasegawa
今10年経って〜思うことあれこれ〜 hasegawa今10年経って〜思うことあれこれ〜 hasegawa
今10年経って〜思うことあれこれ〜 hasegawaalis_lib
 
Sql task answers
Sql task answersSql task answers
Sql task answers
Nawaz Sk
 
New microsoft word document
New microsoft word documentNew microsoft word document
New microsoft word document
Abhishek Arya
 
(Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++ (Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++ Eli Diaz
 
(Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++ (Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++ Eli Diaz
 
Meetup Beleza na Web - Funções analíticas com SQL
Meetup Beleza na Web - Funções analíticas com SQLMeetup Beleza na Web - Funções analíticas com SQL
Meetup Beleza na Web - Funções analíticas com SQL
Bruno Paulino, MBA
 
Sql queries
Sql queriesSql queries
Sql queries
Paritosh Gupta
 

What's hot (20)

array implementation
 array implementation array implementation
array implementation
 
Crash Course to SQL in PHP
Crash Course to SQL in PHPCrash Course to SQL in PHP
Crash Course to SQL in PHP
 
Zen and the Art of Writing SQL Query
Zen and the Art of Writing SQL QueryZen and the Art of Writing SQL Query
Zen and the Art of Writing SQL Query
 
ShopC++
ShopC++ShopC++
ShopC++
 
Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019Dolibarr - information for developers and partners - devcamp Pau 2019
Dolibarr - information for developers and partners - devcamp Pau 2019
 
my
mymy
my
 
Sql lab experiments
Sql lab experimentsSql lab experiments
Sql lab experiments
 
Contraints
ContraintsContraints
Contraints
 
New Query Optimizer features in MariaDB 10.3
New Query Optimizer features in MariaDB 10.3New Query Optimizer features in MariaDB 10.3
New Query Optimizer features in MariaDB 10.3
 
Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functions
 
Data Structures Lab
Data Structures LabData Structures Lab
Data Structures Lab
 
Oracle: Functions
Oracle: FunctionsOracle: Functions
Oracle: Functions
 
今10年経って〜思うことあれこれ〜 hasegawa
今10年経って〜思うことあれこれ〜 hasegawa今10年経って〜思うことあれこれ〜 hasegawa
今10年経って〜思うことあれこれ〜 hasegawa
 
Sql task answers
Sql task answersSql task answers
Sql task answers
 
New microsoft word document
New microsoft word documentNew microsoft word document
New microsoft word document
 
(Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++ (Meta 5) ejemplo vectores dev c++
(Meta 5) ejemplo vectores dev c++
 
(Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++ (Meta 5) ejemplo vectores 2 dev c++
(Meta 5) ejemplo vectores 2 dev c++
 
Meetup Beleza na Web - Funções analíticas com SQL
Meetup Beleza na Web - Funções analíticas com SQLMeetup Beleza na Web - Funções analíticas com SQL
Meetup Beleza na Web - Funções analíticas com SQL
 
Sql queries
Sql queriesSql queries
Sql queries
 
Structure
StructureStructure
Structure
 

Similar to Use shop

Sql commands
Sql commandsSql commands
Sql commands
Christalin Nelson
 
EJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTANEJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTANarkangel8801
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
arrowit1
 
Lecture 3 sql {basics ddl commands}
Lecture 3 sql {basics  ddl commands}Lecture 3 sql {basics  ddl commands}
Lecture 3 sql {basics ddl commands}
Shubham Shukla
 
Day 7 Worksheet.docx
Day 7 Worksheet.docxDay 7 Worksheet.docx
Day 7 Worksheet.docx
atreesgalaxy
 
Entigrity constraint
Entigrity constraintEntigrity constraint
Entigrity constraint
suman kumar
 

Similar to Use shop (10)

Actividad 1
Actividad 1Actividad 1
Actividad 1
 
Sql commands
Sql commandsSql commands
Sql commands
 
EJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTANEJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTAN
 
Benforta
BenfortaBenforta
Benforta
 
Benforta
BenfortaBenforta
Benforta
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
 
Lecture 3 sql {basics ddl commands}
Lecture 3 sql {basics  ddl commands}Lecture 3 sql {basics  ddl commands}
Lecture 3 sql {basics ddl commands}
 
Day 7 Worksheet.docx
Day 7 Worksheet.docxDay 7 Worksheet.docx
Day 7 Worksheet.docx
 
Entigrity constraint
Entigrity constraintEntigrity constraint
Entigrity constraint
 
Sql ejercicio 1
Sql ejercicio 1Sql ejercicio 1
Sql ejercicio 1
 

More from Usukhuu Galaa

Se304
Se304Se304
Se205
Se205Se205
Is320
Is320Is320
Is201
Is201Is201
Rdbms bie daalt
Rdbms bie daaltRdbms bie daalt
Rdbms bie daalt
Usukhuu Galaa
 
Rdbms 300 test
Rdbms 300 testRdbms 300 test
Rdbms 300 test
Usukhuu Galaa
 
DB-2
DB-2DB-2
нийтлэл 1
нийтлэл 1нийтлэл 1
нийтлэл 1
Usukhuu Galaa
 
IT13
IT13IT13
IT14
IT14IT14
IT12
IT12IT12
IT11
IT11IT11
IT10
IT10IT10
IT-9
IT-9IT-9
IT-7
IT-7IT-7
IT-6
IT-6IT-6
IT-5
IT-5IT-5
IT-4
IT-4IT-4
IT-3
IT-3IT-3
IT-2
IT-2IT-2

More from Usukhuu Galaa (20)

Se304
Se304Se304
Se304
 
Se205
Se205Se205
Se205
 
Is320
Is320Is320
Is320
 
Is201
Is201Is201
Is201
 
Rdbms bie daalt
Rdbms bie daaltRdbms bie daalt
Rdbms bie daalt
 
Rdbms 300 test
Rdbms 300 testRdbms 300 test
Rdbms 300 test
 
DB-2
DB-2DB-2
DB-2
 
нийтлэл 1
нийтлэл 1нийтлэл 1
нийтлэл 1
 
IT13
IT13IT13
IT13
 
IT14
IT14IT14
IT14
 
IT12
IT12IT12
IT12
 
IT11
IT11IT11
IT11
 
IT10
IT10IT10
IT10
 
IT-9
IT-9IT-9
IT-9
 
IT-7
IT-7IT-7
IT-7
 
IT-6
IT-6IT-6
IT-6
 
IT-5
IT-5IT-5
IT-5
 
IT-4
IT-4IT-4
IT-4
 
IT-3
IT-3IT-3
IT-3
 
IT-2
IT-2IT-2
IT-2
 

Recently uploaded

原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
obonagu
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 

Recently uploaded (20)

原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 

Use shop

  • 1. use shop create table customer ( C_id int identity, C_name nvarchar(20), C_status nchar(5) ) create table cust_status ( Status_id int, C_status_name nvarchar(20) ) use shop alter table customer add primary key (C_id) alter table customer alter column C_status int alter table cust_status add primary key (Status_id) alter table cust_status alter column Status_id int not null ALTER TABLE customer ADD FOREIGN KEY (C_status) REFERENCES cust_status(Status_id) alter table customer add gender nchar(2) not null alter table customer add constraint gender check (gender in ('er', 'em')) alter table customer add reg_date datetime not null alter table customer drop column reg_date alter table customer add reg_date datetime default getdate() alter table customer alter column reg_date nchar(10) set default ''