text stringlengths 6 9.38M |
|---|
--@Autor(es): Hector Espino Rojas, Néstor Martínez Ostoa
--@Fecha creación: 22/06/2020
--@Descripción: Prueba de la función para determinar si un vuelo existe.
set serveroutput on;
declare
v_id_aeropuerto_origen number;
v_id_aeropuerto_destino number;
v_fecha_hora_salida date;
v_numero_vuelo varchar2(8);
... |
/* Formatted on 2008/05/14 18:34 (Formatter Plus v4.8.8) */
DECLARE
ret_val VARCHAR2 (4000);
sqltext CLOB;
suggestion CLOB;
script CLOB;
BEGIN
sqltext := 'SELECT MAX (wm.documento) FROM PRODISSR.wfq_info_adicional wia, PRODISSR.wfq_mensajes wm WHERE wm.id_mensaje = wia.id_mensaje AND (wm.cod_que... |
//to select movie title,movie year,rating where rating=5
SELECT mov_title,mov_year,rev_stars from movies,rating
where rev_stars=5 and movies.mov_id=rating.mov_id;
|
ALTER TABLE classics ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT KEY;
ALTER TABLE classics DROP id;
DESCRIBE classics; |
--4.Write a SQL query to find all information about all departments (use "TelerikAcademy" database).
SELECT * FROM Departments d
--5.Write a SQL query to find all department names.
SELECT d.name FROM Departments d
--6.Write a SQL query to find the salary of each employee.
SELECT e.FirstName + ' ' + e.LastName AS [Ful... |
--LOG MODIFICACIONES
-- =============================================
-- Author: omar rodriguez
-- Create date: 23-06-2018 4:59pm
-- tablas/sp: MAESTRO
-- Description: Se agrego una columna adicional PERIODO en base a requerimiento NRO:
-- =============================================
CREATE PROCEDURE [ERP].[Usp_Sel_... |
DELETE FROM USER_LOGIN_INFO WHERE USER_ID = /*userId*/'admin' |
SELECT * FROM local_account
WHERE email = ${email}
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.3 (Ubuntu 11.3-1.pgdg18.04+1)
-- Dumped by pg_dump version 11.5
-- Started on 2019-09-11 16:56:10 PDT
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET statement_timeout ... |
CREATE TABLE [app].[Roles_Menus] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Id_Roles] INT NOT NULL,
[Id_Menus] INT NOT NULL,
CONSTRAINT [PK_app.Roles_Menus] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_Roles_Menus_Menus] FOREIGN KEY ([Id_Menus]) REFERENCES [ui].[Menus] ([Id]),
CONSTRAINT [... |
update class set identity = lower(identity);
|
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 25, 2018 at 05:45 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.1.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
--// Fix_EventLog_table
-- Migration SQL that makes the change goes here.
create table TempEventLog (
id varchar(36) not null,
updatedOn timestamp not null default CURRENT_TIMESTAMP,
createdOn timestamp not null default '0000-00-00 00:00:00',
name varchar(255) not null,
ref varchar(255) not null,
refId var... |
CREATE PROC [ERP].[Usp_Sel_Existencia_Pagination]
@Flag BIT,
@Page INT,
@RowsPerPage INT,
@SortDir VARCHAR(20),
@SortType VARCHAR(30),
@RowCount INT OUT
AS
BEGIN
WITH Existencia AS
(
SELECT ROW_NUMBER() OVER
(ORDER BY
--ASC
CASE WHEN(@SortType = 'ID' AND @SortDir = 'ASC') THEN EX.ID END ASC,
CASE WHE... |
ALTER TABLE developers ADD salary INT ;
UPDATE developers SET salary = 300 WHERE id = 1;
UPDATE developers SET salary = 500 WHERE id = 2;
UPDATE developers SET salary = 700 WHERE id = 3;
UPDATE developers SET salary = 1000 WHERE id = 4; |
CREATE OR REPLACE VIEW planet_osm_point AS
SELECT osm_id
-- original columns
, layer as "layer"
, tags as "tags"
, way as "way"
, z_order as "z_order"
-- calculated columns
, osml10n_get_placename_from_tags(tags,true,false,chr(10),'de',way) as localized_name_second
, osml10n_get_placename_from_tags(tags,false... |
--Exo7: Dans la table languages, afficher toutes les données par ordre alphabétique.
SELECT * FROM `languages` ORDER BY `language`;
--ORDER BY est un opérateur qui permet de trier par ordre ascendant et descendant.
--Par défaut, il trie par ordre ascendant.
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.10 (Debian 11.10-0+deb10u1)
-- Dumped by pg_dump version 11.10 (Debian 11.10-0+deb10u1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;... |
ALTER TABLE snippet ADD COLUMN extra JSON;
|
CREATE TABLE IF NOT EXISTS `events` (
`_id` UNSIGNED INTEGER(10) NOT NULL,
`title` varchar(50) DEFAULT NULL,
`description` varchar(500) DEFAULT NULL,
`localization` varchar(150) DEFAULT NULL,
`organization` varchar(150) DEFAULT NULL,
`datetime` varchar(50) DEFAULT NULL
);
INSERT INTO events (`_id`, `title... |
INSERT INTO
public."ClassificationTypeCategory"
(
"ClassificationTypeCategoryID",
"Name",
"IsActive",
"IsDeleted"
)
VALUES (
1000,
'ApplicationID',
TRUE,--:IsActive,
FALSE--:IsDeleted
);
INSERT INTO
public."ClassificationType"
(
"ClassificationTypeID",
"Name",
"Description",
"Classificati... |
-- phpMyAdmin SQL Dump
-- version 2.8.0.1
-- http://www.phpmyadmin.net
--
-- Host: custsql-ipg50.eigbox.net
-- Generation Time: Nov 13, 2016 at 01:36 PM
-- Server version: 5.6.32
-- PHP Version: 4.4.9
--
-- Database: `kemahflowers1_db`
--
-- --------------------------------------------------------
--
-- Table str... |
TRUNCATE Booking;
TRUNCATE Journey;
TRUNCATE Vehicle; |
CREATE VIEW experienced_couriers
AS SELECT * FROM couriers
WHERE experienceInMonths > 12
WITH LOCAL CHECK OPTION;
CREATE VIEW few_products
AS SELECT * FROM products
WHERE count < 4
WITH LOCAL CHECK OPTION; |
-- ** NB! Don't create db by running script from MS Windows cmd - it gives problems with encoding...
-- DROP DATABASE IF EXISTS weather_db;
-- CREATE DATABASE weather_db ENCODING='UTF8' CONNECTION LIMIT = -1;
-- \c weather_db
-- Table that contains weather information for different cities
CREATE TABLE weather_in... |
undefine l_id_debug_group
undefine l_sessionId
define l_id_debug_group = "&1"
define l_sessionId = "&2"
set feedback on
prompt .. Pausing debug for session and/or debug group. (sessionId="&&l_sessionId", debug_group="&&l_id_debug_group")
set feedback off
declare
l_id_debug_group integer := to_number('&&l_id... |
-- 행운의 수 (1~45중 하나) 얻는 함수
create or replace package lucky_pack
as
-- 행운의 수 (1~45중 하나) 얻는 함수
function lucky_num return number;
-- 귀인얻기 프로시저
procedure lucky_name(name out varchar2);
-- 생년월일, 성별, 지역을 입력받아 주민번호를 생성하여
-- out parameter에 설정하고 class4_info 테이블에 추가하는 procedure 작성해보때여
procedure create_s... |
--Exercicios Pag. 112
--1). Retornar os pedidos em Junho de 2007.
USE TSQLFundamentals2008;
SELECT orderid, orderdate, custid, empid
FROM Sales.Orders
--WHERE YEAR(orderdate) = 2007 AND MONTH(orderdate) = 06
--"CORREÇÃO
WHERE YEAR(orderdate) = 2007 AND MONTH(orderdate) = 6
--SOLUÇÃO ACONSELHADA PELO AUTOR
SELECT or... |
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 23, 2015 at 03:27 AM
-- Server version: 5.1.44
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... |
#------------------------------------------------------------
# Script MySQL.
#------------------------------------------------------------
#------------------------------------------------------------
# Table: client
#------------------------------------------------------------
CREATE TABLE client(
I... |
--------------------------------------------------------
-- DDL for Table R_OPP_DEAL_TYPE
--------------------------------------------------------
CREATE TABLE "VF_SPMC_REF"."R_OPP_DEAL_TYPE"
( "OPP_DEAL_TYPE_CD" VARCHAR2(10),
"OPP_DEAL_TYPE_DESC" VARCHAR2(50),
"CREATION_DT" DATE,
"CURR_FLAG_YN" CHAR(1... |
insert into roomtype (roomtype,roomname,price) values("LR", "Luxury",155.22);
insert into roomtype (roomtype,roomname,price) values("SR", "Student",20.00);
insert into roomtype (roomtype,roomname,price) values("CR", "Classic",70.00);
select * from room_type;
insert into employee (employeeid,firstname,lastname,addre... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: cas_authority
-- ------------------------------------------------------
-- Server version 5.6.36
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RE... |
-- pb avec cle client donc renomer PK_eMailUtilisateur => PK_eMailUtilisateur1
DROP TABLE TirageImages;
DROP TABLE Tirage;
DROP TABLE TypePapier;
DROP TABLE FormatPapier;
DROP TABLE TarifFormat;
DROP TABLE Commande;
DROP TABLE TarifDegressif;
DROP TABLE Laboratoire;
DROP TABLE Notation;
DROP TABLE Image;
DROP TABLE A... |
/*Query the list of CITY names from STATION that do not end with vowels. Your result cannot contain duplicates. */
SELECT distinct city from station
where city Not like '%A' and city Not like '%E' and city Not like '%I' and
city Not like '%O' and city not like '%U'; |
SELECT COUNT(Students), Country
FROM Students
GROUP BY Country; |
-- Mysqli dump 10.13 Distrib 5.5.47, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: cv_witra
-- ------------------------------------------------------
-- Server version 5.5.47-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@... |
create table movie_hero (
movie text,
hero text
);
insert into movie_hero(movie, hero) values ('Titanic', 'Leonardo DiCaprio');
insert into movie_hero(movie, hero) values ('The GodFather', 'Marlon Brando');
insert into movie_hero(movie, hero) values ('Inception', 'Leonardo DiCaprio');
insert into movie_hero(... |
CREATE DATABASE IF NOT EXISTS `sisdelegacao` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `sisdelegacao`;
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: localhost Database: sisdelegacao
-- ------------------------------------------------------
-- Server version 5.7.9-log
/*!40101 SET @OL... |
CREATE TABLE `start_page_order` (
`Id` int NOT NULL AUTO_INCREMENT,
`Type` varchar(128) NOT NULL,
`Position` int NOT NULL,
`Header` varchar(128) DEFAULT NULL,
PRIMARY KEY (`Id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
/*
Navicat MySQL Data Transfer
Source Server : RJzz
Source Server Version : 50715
Source Host : localhost:3306
Source Database : rfid
Target Server Type : MYSQL
Target Server Version : 50715
File Encoding : 65001
Date: 2016-12-04 09:54:06
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---------... |
CREATE TABLE [HomeAura].[Sensors]
(
[SensorId] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,
[Name] VARCHAR(50) NULL
)
|
USE Conferencias_DB
INSERT INTO Instituicao(nome, pais, morada) VALUES ('Instituicao 1', 'Portugal', 'Rua X')
INSERT INTO Utilizador(email, nome, nome_instituicao) VALUES('matumbino@email.com', 'Matumbino Chota Grande', 'Instituicao 1')
INSERT INTO Utilizador(email, nome, nome_instituicao) VALUES('tiburcio@email.com',... |
-- 14/12/2014
ALTER TABLE `orders`CHANGE `code` `code` VARCHAR(20) NULL;
ALTER TABLE `orders` ADD `table_name` VARCHAR(20) AFTER `g_code`; |
CREATE PROCEDURE stg.[SetCurrentPointInTime]
@PointInTime DATETIME2
AS
BEGIN
UPDATE stg.PointInTime
SET CurrentPointInTime = @PointInTime
END
|
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Nov 14, 2018 at 04:45 PM
-- Server version: 5.6.34-log
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
/* Formatted on 17/06/2014 18:05:24 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_MIS_AGRU
(
COD_SNDG,
DESC_NOME_CONTROPARTE,
VAL_PARTITA_IVA,
VAL_SETTORE_ECONOMICO,
VAL_RAMO_ECONOMICO,
FLG_ART_136,
COD_SNDG_SOGGETTO,
VAL_SEGMENTO_REGOLAMENTARE,
DTA_SEGMENTO_REGOLA... |
DROP KEYSPACE IF EXISTS reservations;
CREATE KEYSPACE reservations
WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor' : 1}
AND durable_writes = false;
USE reservations;
CREATE TYPE reservation (
id uuid,
reservee text,
reservation_time text
);
CREATE TABLE restaurants (
id uuid,
name text,... |
if (exists(select * from sys.columns where Name = N'ProductBonusCost' and Object_ID = Object_ID(N'prod.WishListItemNotifications')))
begin
EXEC sp_rename '[prod].[WishListItemNotifications].ProductBonusCost', 'ItemBonusCost', 'COLUMN';
end
if (exists(select * from sys.columns where Name = N'ProductTotalCost' and Obje... |
CREATE DATABASE db_ecommerce;#Banco de Dados
USE db_ecommerce;
CREATE TABLE tb_Produtos(#Tabela Produtos
id BIGINT(5)AUTO_INCREMENT,#Meus atributos
Tipo VARCHAR(20) NOT NULL,
Calca VARCHAR(20) NOT NULL,
Cor VARCHAR(20) NOT NULL,
Tamanho INT NOT NULL,
Codigo INT NOT NULL,
Comprimento VARCHAR(20) NOT NULL,
Preco VARCHA... |
-- =======================================================================
-- 03_SafeSendFunctions
-- =======================================================================
CREATE TABLE public."SafeSendGroup" (
"SafeSendGroupID" UUID NOT NULL,
"OrganisationTypeID" INTEGER NOT NULL,
"Name" VARCHAR(100) NOT NULL... |
INSERT INTO authority (name) VALUES
('ROLE_ADMIN'),
('ROLE_GUEST');
-- password for all users is '12345'
INSERT INTO guest (id, first_name, last_name, email_address, username, password, active) VALUES
(1001, 'Petar', 'Petrović', 'ppetrovic@gmail.com', 'perica', '$2a$04$iLVT9N/5RKaS1bMXEmueauu7pU1ZROAxtRT0x... |
create table definitions
(
id varchar(255) not null,
version varchar(255) not null,
name varchar(255),
type varchar(255),
endpoint varchar(255),
primary key (id, version)
);
create table definitions_addons
(
process_id varchar(255) not null,
process_version varchar(2... |
-- Exercise 16
--When displaying the **Students** table, make an alias of the **PostalCode** column, the column should be called **Zip** instead.
SELECT *, PostalCode AS 'Zip' FROM Students; |
-- 查詢學過“張三”老師所教的課的同學的學號、姓名;
SELECT s.s_id, s.s_name
FROM student s JOIN score sc ON s.s_id = sc.s_id
JOIN course c ON sc.c_id = c.c_id
JOIN teacher t ON c.t_id = t.t_id
WHERE t.t_name = '張三' |
/*Tabulky*/
CREATE TABLE Druh(
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Nazev` enum('Domaci','Divoke','Ochocene') DEFAULT NULL,
PRIMARY KEY (`Id`)
);
CREATE TABLE Zvire (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`Nazev` varchar(50) NOT NULL,
`Jmeno` varchar(20) DEFAULT NULL,
`Druh` int(11) DEFAULT NULL,
`Noh... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 13, 2021 at 06:01 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
# 1、系统管理员用户表,包括用户名和密码 ,创建管理员用户就会到这里
select * from sys_admin_user s
where s.email='yujin.zhang@duodian.com';
-- 部门表
SELECT * from sys_department ;
-- 管理员部门对应表
select * from sys_dept_admin_user s
WHERE s.admid = '44';
# 2、系统角色表
select * from sys_auth_role
# 3、系统角色 和 用户id表
-- private Long id;
-- pr... |
SET SERVEROUTPUT ON;
CREATE OR REPLACE PROCEDURE teste(
departamento departments.department_id%TYPE
)
IS
CURSOR emp_cursor IS
SELECT employee_id,last_name,job_title,salary,department_id
FROM employees_temp
JOIN jobs j
USING (job_id)
WHERE employee_id IN (SELECT mana... |
set linesize 400
col tablespace_name format a15
col file_size format 99999
col file_name format a50
col hwm format 99999
col can_save format 99999
SELECT tablespace_name, file_name, file_size, hwm, file_size-hwm can_save
FROM (SELECT /*+ RULE */ ddf.tablespace_name, ddf.file_name file_name,
ddf.bytes/1048576 fi... |
create database if not exists reportdb;
create user if not exists 'DBUser'@'localhost' identified by 'DBPassword';
grant all privileges on reportdb.* to 'DBUser'@'localhost';
flush privileges ; |
SELECT @scm := dbid FROM concept WHERE id = 'CM_DiscoveryCode';
INSERT IGNORE INTO concept
(document, id, scheme, code, name, description)
VALUES
-- GENERAL/GLOBAL --
(1, 'DM_ambulanceNumber', @scm, 'DM_ambulanceNumber', 'Ambulance number', 'Ambulance number');
-- Context maps
INSERT INTO map_context_meta
(provider, ... |
select * from loans;
|
DROP SCHEMA IF EXISTS songs;
CREATE SCHEMA songs;
USE songs;
DROP TABLE IF EXISTS members;
CREATE TABLE members (
user_id varchar(50) PRIMARY KEY,
city int(30),
age int(10),
gender varchar(10),
registration_method int(10),
registration_time int(20),
expiration_date int(20)
);
LOAD DATA LOCAL INFILE... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 03, 2021 at 08:14 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
create table Users
(
userID int auto_increment,
email varchar(511) not null,
password varchar(255) not null,
firstName varchar(255) null,
middleName varchar(255) null,
lastName varchar(255) null,
isAdmin tinyint default 0 null,
isShelter ... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 03, 2015 at 02:09 PM
-- Server version: 5.6.21
-- PHP Version: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
SELECT title FROM books WHERE released_year != 2007;
SELECT title FROM books WHERE author_lname != Lahiri;
SELECT title FROM books WHERE title NOT LIKE 'W%';
SELECT title, released_year FROM books WHERE released_year > 2000 ORDER BY released_year;
SELECT title, released_year FROM books WHERE released_year >... |
-- phpMyAdmin SQL Dump
-- version 3.5.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 18, 2013 at 02:02 PM
-- Server version: 5.5.29
-- PHP Version: 5.4.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Table structure for table `broadcasts`
--
CREATE TABLE IF NOT ... |
INSERT INTO product(id,name) VALUES (1,'Altaf');
INSERT INTO product(id,name) VALUES (2,'Bijaya');
INSERT INTO product(id,name) VALUES (3,'Ram'); |
/*
Philip Burggraf
Lab 13 - PL
*/
--1.
SET SERVEROUTPUT ON;
DECLARE
num NUMBER := 10;
BEGIN
DBMS_OUTPUT.PUT_LINE('The value of num is: ' || num);
END;
/
--2.
DECLARE
num_of_students NUMBER;
BEGIN
SELECT COUNT(*) INTO num_of_students
FROM STUDENT.STUDENT;
DBMS_OUTPUT.PUT_LINE('The number of s... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Gazdă: 127.0.0.1
-- Timp de generare: iun. 15, 2021 la 08:44 PM
-- Versiune server: 10.4.19-MariaDB
-- Versiune PHP: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_... |
/*
Warnings:
- You are about to drop the `todo` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `user` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "todo" DROP CONSTRAINT "todo_authorId_fkey";
-- D... |
DO $$
-- declare
BEGIN
/* pl/pgsql here */
END $$;
|
CREATE TABLE `sklib`.`s_monster`(
`id` INT NOT NULL AUTO_INCREMENT UNIQUE ,
`name` VARCHAR(255) NOT NULL ,
`description` TEXT ,
`min_base_damage` FLOAT NOT NULL ,
`inc_min_base_damage` FLOAT ,
`max_base_damage` FLOAT NOT NULL ,
`inc_max_base_damage` FLOAT ,
`level` INT NOT NULL ,
`str... |
CREATE TABLE [ERP].[TrabajadorFamilia] (
[ID] INT IDENTITY (1, 1) NOT NULL,
[IdTrabajador] INT NULL,
[IdEntidad] INT NULL,
[IdVinculoFamiliar] INT NULL,
[FechaDeAlta] DATETIME NULL,
[IdEstablecimiento] INT ... |
SET search_path TO "COMMON";
-- MOLEQULE COMMON DATA SCRIPT
-- INSERTS
INSERT INTO "User" ("SERIAL", "ID", "NAME", "PASSWORD", "ADMOR", "MAIN", "IS_PARTNER", "ESTADO", "PIN") VALUES (0, '000000', 'moladmin', 'fcabbe1bfb630c6e6a6c07d174275e45', TRUE, TRUE, FALSE, 10, '0000');
INSERT INTO "User" ("SERIAL", "ID", "NAME... |
/*
[데이터베이스]
[하] 1. 테이블 구조변경 형식을 기본 예제와 함께 기술하세요.
alter table 테이블명
modify 컬럼 데이터유형 옵션1
옵션1 (default 기본데이터)
[하] 2. 테이블 구조변경의 한계(데이터 입력, 유형, 크기 별로)를 기술하세요.
1) 데이터 입력
- 작은 크기에서 큰 크기로의 변경은 가능하다.
- 하지만 있는 데이터의 범위보다 작게 변경하면 에러가 발생한다.
2) 데이터 유형
- varchar2 <=> char 간의 유형 변경은 가능하다.
- 그 외에 유형이 달라질 때 에러가 발생한다
3) 데이터 ... |
select
*
from public.machine,
jsonb_to_record(ma_jsonb) as x (
ma_name text,
ma_maxsizewidth text,
ma_maxsizeheight text,
ma_minsizewidth text,
ma_minsizeheight text,
ma_sizemeasure text,
ma_totalinks text,
ma_fullcolor text,
ma_printbg text,
ma_process text,
ma_status... |
SELECT LineID, AVG(Passangers) AS AVER
INTO #THISDAY
FROM LinkerT
GROUP BY LineID
SELECT *
FROM #THISDAY
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 31, 2018 at 01:50 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
-- test init data
-- insert users test data
insert into user_ (id,login,password) values (1,'admin','admin');
insert into user_ (id,login,password) values (2,'user01','user01');
-- insert members test data
INSERT INTO member(id,country,name_street,num_street,pc_town,town,amount,birthday,email,lastname,firstname,payme... |
PARAMETERS [@VentaAnticipoID] Text (255);
SELECT A.VentaID,
Format(A.Total,"#,##0.00;(#,##0.00)") AS Neto,
Format(A.IGV,"#,##0.00;(#,##0.00)") AS IGV,
Format(A.Total-iif(isnull(B.Asignado),0,B.Asignado),"#,##0.00;(#,##0.00)") AS Saldo,
iif(A.IGV>0,"1","0") AS CheckIGV,
A.IGVTasa,
... |
SELECT model, sum(w*x) FROM(
SELECT w,model, LEN(REPLACE(model,w,'ww')) - LEN(model) as x FROM Product a
CROSS JOIN (select w from (select 1 as w
union all
select 2 as w
union all
select 3 as w
union all
select 4 as w
union all
select 5 as w
union all
select 6 as w
union all
select 7 as w
union all
select 8 as w
union... |
CREATE DATABASE fivestar;
\c fivestar
CREATE TABLE foods (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
cents INTEGER,
cuisine VARCHAR(255),
free BOOLEAN
);
CREATE TABLE parties (
id SERIAL PRIMARY KEY,
table_number INTEGER,
is_paid BOOLEAN,
cents INTEGER
);
CREATE TABLE orders (
id SERIAL PRIMARY K... |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------... |
with orders as (
select * from "data_platform_prod"."data_science"."stg_order_cst"
),
events as (
select * from "data_platform_prod"."data_science"."stg_events"
),
flash as (
select * from "data_platform_prod"."data_science"."stg_flash"
),
order_flash as (
SELECT *
from orders LEFT JOIN flash ON fla... |
-- nb: this query assume it will take a variety of field content: refnames, messy free text, and output something "clean"
SELECT DISTINCT cc.id AS id, STRING_AGG(regexp_replace(regexp_replace(grp.FIELD, '^.*\)''(.*)''$', '\1'), E'[\\t\\n\\r]+', ' ', 'g'), '␥') AS FIELD_ss
FROM XTABLE cc
JOIN misc m on (m.id = cc.id AND... |
BEGIN TRANSACTION;
CREATE TEMPORARY TABLE perceptrons_backup(id, id_layer, id_nn, weights, bias, number_input, learning_rate);
INSERT INTO perceptrons_backup SELECT id, id_layer, id_nn, weights, bias, number_input, learning_rate FROM perceptrons;
DROP TABLE perceptrons;
CREATE TABLE perceptrons(id, id_layer, id_nn, wei... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 01 Okt 2019 pada 07.16
-- Versi Server: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... |
INSERT INTO serials (serial_id) VALUES (0);
|
/*
* View: schema_tables_with_full_table_scans
*
* Find tables that are being accessed by full table scans
* ordering by the number of rows scanned descending
*
* mysql> select * from schema_tables_with_full_table_scans limit 5;
* +------------------+-------------------+-------------------+
* | object_schema ... |
CREATE TABLE people(
name text,
age integer,
occupation text
);
INSERT INTO people(name, age, occupation)
VALUES ('Abby', 34, 'biologist'),
('Mu''nisah', 26, NULL),
('Mirabelle', 40, 'contractor');
SELECT *
FROM people
WHERE name = 'Mu''nisah';
SELECT name, age, occupation
FRO... |
USE sdis29;
CREATE TABLE horaires(
idHoraires int AUTO_INCREMENT,
libelle varchar(20),
PRIMARY KEY(idHoraires)
);
CREATE TABLE disponibilite(
idDisponibilite int AUTO_INCREMENT,
libelle varchar(20),
PRIMARY KEY(idDisponibilite)
);
CREATE TABLE feuilleGarde(
dteJour date,
idHoraires int,
... |
create table word_cloud(
event_time timestamp,
word_key text,
word text,
word_count int,
primary key(event_time,word_key)
) with clustering order by word_key desc |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET NAMES UTF8;
CREATE TABLE IF NOT EXISTS `message` (
`email` varchar(100) NOT NULL,
`title` varchar(100) NOT NULL,
`contents` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `users` (
`username` varchar(100) NOT NULL,
`password` ... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 03-09-2018 a las 06:42:40
-- Versión del servidor: 10.1.34-MariaDB
-- Versión de PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
/*
Project Option: Coyote Residence Office
TEAM: King James & The Knights of the Data Table
Data Load Method 2: Insert Using Substitution Variables
Done By: James Small
*/
INSERT INTO takes_course(student_number,course_number)
values ('&student_number','&course_number');
|
create database top_competitors;
use top_competitors;
create table hackers(
hacker_id int,
name varchar(100)
);
insert into hackers(hacker_id, name) values
(5580, 'Rose'),
(8439, 'Angela'),
(27205, 'Frank'),
(52243, 'Patrick'),
(52348, 'Lisa'),
(57645, 'Kimberly'),
(77726, 'Bonnie'),
(83082,... |
/* Put your data in here and query it! */
/* Put your data in here and query it! */
CREATE TABLE TOP_MOVIES
(id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,rating INTEGER,RELEASED_YEAR INTEGER);
INSERT INTO top_movies(name,rating,released_year) VALUES("The Shawshank Redemption",9.3,1994);
INSERT INTO top_movies(name,r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.