SQL server procedure
use master drop database memosdb create database memosdb use memosdb sp_help create table dbo.Memos ( Num Int Identity(1,1) Primary key, [Name] varchar(25)Not null, Email varchar(100) null, title varchar(150) not null, postdate smalldatetime default(getdate()), postIP varchar(15) ) go insert memos(name,email,title,postip)values('홍길동','h2h@h.com','홍길동입니다','127.0.0.1') insert memos(name,email,titl..
더보기
SQL Select 문제
CREATE DATABASE Sales GO USE Sales go CREATE TABLE EMP (EMPNO int not null, ENAME VARCHAR(10), JOB VARCHAR(9), MGR int, HIREDATE datetime, SAL int, COMM int, DEPTNO int) go INSERT INTO EMP VALUES (7369,'SMITH','CLERK',7902,'1980-12-17',800,null,20) INSERT INTO EMP VALUES (7499,'ALLEN','SALESMAN',7698,'1981-02-20',1600,300,30) INSERT INTO EMP VALUES (7521,'WARD','SALESMAN',7698,'1981-02-22',1250,..
더보기
SQL server 2005(4) -데이터검색1
use testDB go select 고객정보.userID, UserName, Age FROM 고객정보, 회사정보 from 절에 두개의 테이블 이름을 사용하여 두 테이블로부터 검색하는 예 select*from 고객정보 select*from 회사정보 select A.userID,username,age,company,pay from 고객정보 A, 회사정보 B where A.userID = B.userID select userid, username, age from 고객정보 where age=20 and age select*from 회사정보 where userid in(select userid from 고객정보 where job='교직자' and addr1='서울특별시') 와일드 카드 문자를 사용하여 검색하는..
더보기