Yam Code
Sign up
Login
New paste
Home
Trending
Archive
English
English
Tiếng Việt
भारत
Sign up
Login
New Paste
Browse
/*viết thủ tục thực hiên các yêu cầu sau, sau đó dùng thủ tục thực thi 1 trường hợp cụ thể (tham số tùy chọn)*/ --1.tính lương của 1 mã nhân viên (tham số) create proc calEmplyeeSalary(@id char(3)) as begin select HONV,TENLOT, TENNV, LUONG from NHANVIEN where MANV = @id end exec calEmplyeeSalary '009' drop proc calEmplyeeSalary --2.xem thông tin của 1 mã nhân viên (tham số) create proc displayEmployeeInfo(@id char(3)) as begin select * from NHANVIEN where MANV = @id end exec displayEmployeeInfo '003' --3.nv có lương của cao nhất create proc highestEmployeeSalary as begin select HONV,TENLOT, TENNV, LUONG from NHANVIEN where LUONG >= ( SELECT MAX(LUONG) from NHANVIEN) end exec highestEmployeeSalary --4.nhân viên có lương cao nhất của 1 tên phòng (tham số) create proc highestEmployeeSalaryInRoom( @tenphong nvarchar(20)) as begin select HONV,TENLOT, TENNV, LUONG, TENPHG from NHANVIEN, PHONGBAN where PHG = MAPHG and TENPHG = @tenphong group by HONV,TENLOT, TENNV, LUONG, TENPHG having LUONG >= ( select MAX(LUONG) from NHANVIEN, PHONGBAN where PHG = MAPHG and TENPHG = @tenphong) end select NHANVIEN.* from NHANVIEN, PHONGBAN where PHG = MAPHG and TENPHG = N'Nghiên cứu ' exec highestEmployeeSalaryInRoom N'Nghiên cứu ' drop proc highestEmployeeSalaryInRoom --5.2 nhân viên có lương cao nhất create proc twoHighestEmployeeSalary as begin select top 2 HONV,TENLOT, TENNV, LUONG from NHANVIEN order by LUONG desc end exec highestEmployeeSalary --6.20% nhân viên có lương cao nhất create proc highestEmployeeSalaryByPercent( @percent tinyint) as begin select top (@percent) percent HONV,TENLOT, TENNV, LUONG from NHANVIEN order by LUONG desc end exec highestEmployeeSalaryByPercent 20 --7.phòng ban có nhiều nv nhất create proc roomHasMaxEmployee as begin select COUNT(MANV), TENPHG from NHANVIEN,PHONGBAN where PHG = MAPHG group by TENPHG having COUNT(MANV) >= all( select COUNT(MANV) from NHANVIEN,PHONGBAN where PHG = MAPHG group by TENPHG) end --8.2 phòng ban có nhiều nhân viên nhất create proc twoRoomHasMaxEmployee as begin select top 2 COUNT(MANV) as fuck, TENPHG from NHANVIEN,PHONGBAN where PHG = MAPHG group by TENPHG order by fuck desc end exec twoRoomHasMaxEmployee --9.nv có địa chỉ ở tphcm create proc showEmployeeByAddress( @address nvarchar(50)) as begin select HONV,TENLOT, TENNV, DCHI from NHANVIEN where DCHI like @address end exec showEmployeeByAddress N'%Tp HCM%' --10. nv làm việc cho 1 tên đề án create proc showEmployeeByProjectName(@projectName nvarchar(30)) as begin select HONV,TENLOT, TENNV,TENDA from NHANVIEN,DEAN where PHG = PHONG and TENDA = @projectName end exec showEmployeeByProjectName N'Cáp quang '
Paste Settings
Paste Title :
[Optional]
Paste Folder :
[Optional]
Select
Syntax Highlighting :
[Optional]
Select
Markup
CSS
JavaScript
Bash
C
C#
C++
Java
JSON
Lua
Plaintext
C-like
ABAP
ActionScript
Ada
Apache Configuration
APL
AppleScript
Arduino
ARFF
AsciiDoc
6502 Assembly
ASP.NET (C#)
AutoHotKey
AutoIt
Basic
Batch
Bison
Brainfuck
Bro
CoffeeScript
Clojure
Crystal
Content-Security-Policy
CSS Extras
D
Dart
Diff
Django/Jinja2
Docker
Eiffel
Elixir
Elm
ERB
Erlang
F#
Flow
Fortran
GEDCOM
Gherkin
Git
GLSL
GameMaker Language
Go
GraphQL
Groovy
Haml
Handlebars
Haskell
Haxe
HTTP
HTTP Public-Key-Pins
HTTP Strict-Transport-Security
IchigoJam
Icon
Inform 7
INI
IO
J
Jolie
Julia
Keyman
Kotlin
LaTeX
Less
Liquid
Lisp
LiveScript
LOLCODE
Makefile
Markdown
Markup templating
MATLAB
MEL
Mizar
Monkey
N4JS
NASM
nginx
Nim
Nix
NSIS
Objective-C
OCaml
OpenCL
Oz
PARI/GP
Parser
Pascal
Perl
PHP
PHP Extras
PL/SQL
PowerShell
Processing
Prolog
.properties
Protocol Buffers
Pug
Puppet
Pure
Python
Q (kdb+ database)
Qore
R
React JSX
React TSX
Ren'py
Reason
reST (reStructuredText)
Rip
Roboconf
Ruby
Rust
SAS
Sass (Sass)
Sass (Scss)
Scala
Scheme
Smalltalk
Smarty
SQL
Soy (Closure Template)
Stylus
Swift
TAP
Tcl
Textile
Template Toolkit 2
Twig
TypeScript
VB.Net
Velocity
Verilog
VHDL
vim
Visual Basic
WebAssembly
Wiki markup
Xeora
Xojo (REALbasic)
XQuery
YAML
HTML
Paste Expiration :
[Optional]
Never
Self Destroy
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Status :
[Optional]
Public
Unlisted
Private (members only)
Password :
[Optional]
Description:
[Optional]
Tags:
[Optional]
Encrypt Paste
(
?
)
Create New Paste
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Site Languages
×
English
Tiếng Việt
भारत