Dddd
Codigo:1123028007
Grupo s2ad
create database libross
use libross
create table libross(
codigo int identity,
titulo varchar(40)not null,
autor varchar(20),editorial varchar(50),
precio decimal(6,2),
primary key(codigo)
)
insert into libross values('el aleph','borges','emece',25.33)
insert into libross values('java en 10 minutos','mario molina','sigloxxt',50.65);
insert into libross values('alicia en el pais de las maravillas','lewis carroll','emece',19.95)
insert into libross values('alicia en el pais de las maravillas','lewiscarroll','planeta',15)
select * from libross
select * from libross order by editorial desc;
select * from libross order by titulo,editorial;
select * from libross order by titulo,ASCII,editorial desc;
select* from titulo,autor from libross order by precio;
select * from libross where(autor='borges')and(precio<=20);
select * from libross where autor='borges' or editorial='planeta';
select * fromlibross where not editorial='planeta';
select * from libross where(autor='borges')or(editorial='paidos' and precio<20);
select * from libross where(autor='borges'or editorial='paidos')and(precio<20);
select * from libross where precio between 20 and 40
select * from libross where precio not between 20 and 35
select COUNT (*) from libross;
select titulo,precio from libross whereprecio like '%.00';
select titulo,precio from libross where precio like '2_.%';
select titulo,autor,editorial from libross where editorial like'[^pn]%';
select COUNT (*) from libross whereeditorial='planeta';
select COUNT(precio) from libross;
select SUM (cantidad)from libross;
select MAX (precio) from libross;
select AVG(precio)from libross where titulo like '%php%';
create tablelibross1(
codigo int identity,
titulo varchar(30)not null,
autor varchar(30)default 'desconocido',
editorial varchar(15),
precio decimal(5,2),
cantidad tinyint,
primary key (codigo)
)
insert...
Regístrate para leer el documento completo.