Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
17 views
Create Database Company1
database query for company instance
Uploaded by
bisrat
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download now
Download
Save create database company1 For Later
Download
Save
Save create database company1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
17 views
Create Database Company1
database query for company instance
Uploaded by
bisrat
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download now
Download
Save create database company1 For Later
Carousel Previous
Carousel Next
Save
Save create database company1 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 2
Search
Fullscreen
Yared 56/70 group 14/15 self 5/5 yekrb aleka 7/10 total 82
create database company1
create table product(pid int,
pname varchar(40),descrption varchar(40), price int,
constraint pk primary key(pid)
)
create table orders(oid int primary key,
cname varchar(40),ordardate datetime,status char(30))
create table orderdetail
(pid int constraint pk foreign key references product(pid),
oid int foreign key references orders(oid),qty int)
insert into product values ( 6,'samsung','brand',2000)
insert into orders values (3,'aster','1/2/2000','complete')
insert into orderdetail values(1,1,6)
select * from orders
select * from orderdetail
select * from product
/*A*/ select cname from orders s left join orderdetail e on s.oid=e.oid
where e.oid is null
select cname from orders inner join orderdetail f on orders.oid=f.oid
group by
f.oid, orders.cname having
COUNT(orders.cname)>1
select cname from orders where ordardate = GETDATE()
select upper(cname) from orders
select distinct pname from product
select pname from product group by pname having COUNT(pname)>1
select cname+ ' ' + status from orders
select pname,price from product
where price in
(select price from product
group by price having
count(price)>1)
select COUNT(price) from product where price=2000
select pname from product c inner join orderdetail a on c.pid=a.pid where
a.pid = 2
select sum(price) as total from product
select pname from product where pname like ''
select * into productcopy2 from product where 1=2
select * from productcopy
select * from productcopy2
Select SUBSTRING(pname,2,3) as firstthree from product
select MAX(price) from product
You might also like
SQL Query Purchase Order Example
PDF
100% (2)
SQL Query Purchase Order Example
34 pages
Module 2 SQL
PDF
No ratings yet
Module 2 SQL
10 pages
Database Essentials 18S PDF
PDF
No ratings yet
Database Essentials 18S PDF
97 pages
70 433
PDF
No ratings yet
70 433
111 pages
Create Table Manufacturers
PDF
No ratings yet
Create Table Manufacturers
2 pages
EXP9 Triggers
PDF
No ratings yet
EXP9 Triggers
4 pages
ASSIGNMENT SQL 5
PDF
No ratings yet
ASSIGNMENT SQL 5
3 pages
Database Commands - 2
PDF
No ratings yet
Database Commands - 2
12 pages
GESCOM
PDF
No ratings yet
GESCOM
5 pages
T-SQL Cheat Sheet
PDF
100% (1)
T-SQL Cheat Sheet
20 pages
DWR
PDF
No ratings yet
DWR
99 pages
Create Clienti Table
PDF
No ratings yet
Create Clienti Table
5 pages
Ahtisham Ali Lab6
PDF
No ratings yet
Ahtisham Ali Lab6
7 pages
Praktikum - Bagian 1: UNION & UNION ALL: Select From Where
PDF
No ratings yet
Praktikum - Bagian 1: UNION & UNION ALL: Select From Where
13 pages
SQL
PDF
No ratings yet
SQL
5 pages
Mod5 SQL
PDF
No ratings yet
Mod5 SQL
8 pages
collage level
PDF
No ratings yet
collage level
2 pages
[CSDL]T SQL Script Procedure Function (HD)
PDF
No ratings yet
[CSDL]T SQL Script Procedure Function (HD)
4 pages
Query - Tuning Hints
PDF
No ratings yet
Query - Tuning Hints
58 pages
query1 (2)
PDF
No ratings yet
query1 (2)
12 pages
DWH Detailedproject
PDF
No ratings yet
DWH Detailedproject
17 pages
70 - SQL-with-PostgreSQL-cheatsheet
PDF
No ratings yet
70 - SQL-with-PostgreSQL-cheatsheet
5 pages
Examples of Using The SELECT Statement
PDF
No ratings yet
Examples of Using The SELECT Statement
13 pages
E ComerceSystem
PDF
No ratings yet
E ComerceSystem
11 pages
10-Course-Database Northwind - 6 With Answers
PDF
No ratings yet
10-Course-Database Northwind - 6 With Answers
3 pages
10-Course-Database Northwind - 6 With Answers
PDF
No ratings yet
10-Course-Database Northwind - 6 With Answers
3 pages
10-Course-Database Northwind - 6 With Answers
PDF
No ratings yet
10-Course-Database Northwind - 6 With Answers
3 pages
sm07152 DB Lab10
PDF
No ratings yet
sm07152 DB Lab10
13 pages
Microsoft - Practicetest.70 433.v2013!06!16.by - Lionking
PDF
No ratings yet
Microsoft - Practicetest.70 433.v2013!06!16.by - Lionking
138 pages
Manejo de Triggers en SQL Server 2000 Pag:: Raiserror @@rowcount
PDF
No ratings yet
Manejo de Triggers en SQL Server 2000 Pag:: Raiserror @@rowcount
4 pages
Consulta 1
PDF
No ratings yet
Consulta 1
13 pages
Consultas Resueltas
PDF
No ratings yet
Consultas Resueltas
14 pages
1 Data Warehouse Construction Real Life Problem To Be Defined For Data
PDF
No ratings yet
1 Data Warehouse Construction Real Life Problem To Be Defined For Data
3 pages
DBMS Part-2
PDF
No ratings yet
DBMS Part-2
4 pages
D.B.M.S Day 2
PDF
No ratings yet
D.B.M.S Day 2
2 pages
First DWH - Script
PDF
No ratings yet
First DWH - Script
7 pages
PostgreSQL Q&A
PDF
No ratings yet
PostgreSQL Q&A
2 pages
Week13 DB Lab - SQL
PDF
No ratings yet
Week13 DB Lab - SQL
3 pages
AdventureWorks
PDF
No ratings yet
AdventureWorks
3 pages
ds
PDF
No ratings yet
ds
2 pages
Practical File Questions With Answers
PDF
No ratings yet
Practical File Questions With Answers
7 pages
Documantation
PDF
No ratings yet
Documantation
12 pages
011224
PDF
No ratings yet
011224
4 pages
SUBQUERYY
PDF
No ratings yet
SUBQUERYY
11 pages
IP Assignment FinalTerm
PDF
No ratings yet
IP Assignment FinalTerm
4 pages
hek
PDF
No ratings yet
hek
52 pages
lemoa
PDF
No ratings yet
lemoa
52 pages
Tables
PDF
No ratings yet
Tables
27 pages
Sasanka Rajowar BTech Ctis 002
PDF
No ratings yet
Sasanka Rajowar BTech Ctis 002
33 pages
computer Project
PDF
No ratings yet
computer Project
12 pages
Assignment-3 Database
PDF
No ratings yet
Assignment-3 Database
6 pages
practicals ak
PDF
No ratings yet
practicals ak
5 pages
Solution
PDF
No ratings yet
Solution
3 pages
IP Assignment FinalTerm
PDF
No ratings yet
IP Assignment FinalTerm
4 pages
DBMS-TONMOY
PDF
No ratings yet
DBMS-TONMOY
7 pages
CS FAQ 1-12
PDF
No ratings yet
CS FAQ 1-12
12 pages
CSDL_OTCK
PDF
No ratings yet
CSDL_OTCK
3 pages
Atlantis User Manual A08-LN1200-W & A08-LS1500-W - V3.2 A
PDF
No ratings yet
Atlantis User Manual A08-LN1200-W & A08-LS1500-W - V3.2 A
54 pages
150+ C Pattern Programs
From Everand
150+ C Pattern Programs
Hernando Abella
No ratings yet
Computer Engineering Laboratory Solution Primer
From Everand
Computer Engineering Laboratory Solution Primer
Karan Bhandari
No ratings yet