zoukankan      html  css  js  c++  java
  • T-sql创建表,插入数据

    SET NOCOUNT ON;
    USE hibernateSqlServer
    GO
    IF OBJECT_ID('Orders') IS NOT NULL
        DROP TABLE Orders;
    GO
    IF OBJECT_ID('Customers') IS NOT NULL
        DROP TABLE Customers
    GO
    CREATE TABLE Customers
    (customerid CHAR(5) NOT NULL PRIMARY KEY,
    city VARCHAR(10) NOT NULL);
    INSERT INTO Customers(customerid,city) VALUES('FISSA','Madrid');
    INSERT INTO Customers(customerid,city) VALUES('FRNDO','Madrid');
    INSERT INTO Customers(customerid,city) VALUES('KRLOS','Madrid');
    INSERT INTO Customers(customerid,city) VALUES('MRPHS','Zion');
    CREATE TABLE Orders
    (
      orderid INT NOT NULL PRIMARY KEY,
      customerid CHAR(5) NULL REFERENCES Customers(customerid)
    );
    INSERT INTO Orders(orderid,customerid) VALUES(1,'FRNDO');
    INSERT INTO Orders(orderid,customerid) VALUES(2,'FRNDO');
    INSERT INTO Orders(orderid,customerid) VALUES(3,'KRLOS');
    INSERT INTO Orders(orderid,customerid) VALUES(4,'KRLOS');
    INSERT INTO Orders(orderid,customerid) VALUES(5,'KRLOS');
    INSERT INTO Orders(orderid,customerid) VALUES(6,'MRPHS');
    INSERT INTO Orders(orderid,customerid) VALUES(7,NULL);
  • 相关阅读:
    Promise、Async、await
    Generator
    模块化
    继承
    原型
    == vs ===
    深浅拷贝
    this
    nodejs中搭建服务器
    sql中constraint主要是增加约束
  • 原文地址:https://www.cnblogs.com/POLzj/p/6011554.html
Copyright © 2011-2022 走看看