--step1: Creating database
create database studs
--step2: DB Details
sp_helpdb --Tot dbs
sp_helpdb studs --studs db details
--step3: Creating schema
use studs
go
create schema Library1
go
select * from sys.schemas --To
disp all schemas
--step4: Table
create table emps(empid int,ename varchar(40),sal money)
sp_help --list all objects
sp_help emps --To disp structure of table
create table Library1.Books(bid int,bname varchar(40))
--step5: Working with data
insert emps values(1,'Rakesh',4500),(2,'Rafi',4500)
select * from emps
update emps set sal=9000 where empid=1
dbcc log(0) --To
open the log file
dbcc log(0,3) --To check complete info
delete from emps where empid=2
truncate table emps
No comments
Post a Comment
Note: Only a member of this blog may post a comment.