Hot answers tagged

3

CREATE TABLE IF NOT EXISTS `tblproduct` ( `id` int(8) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `code` varchar(255) NOT NULL, `image` text NOT NULL, `price` double(10,2) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `product_code` (`code`) ) <<<<------- put semi-colon here. Your problem here is with the last line of your ...


3

It's a special datatype for storing ip addresses. It would be more compact that the string representation of the same information as well as type safe. inet An IP address. It can be either 4 bytes long (IPv4) or 16 bytes long (IPv6). There is no inet constant, IP address should be inputed as strings https://cassandra.apache.org/doc/cql3/CQL.html


2

No, Laravel does not backup your database data. It is simply a PHP framework. The only thing Laravel backs up as far as the database goes is the table schema if you used the migration features in the framework. Cloud infrastructures like Amazon routinely have nightly backups if using their RDS service. Your ability to recover the lost data depends on the ...


1

It seems you haven't added to service account as a database user to customdb: USE customdb; CREATE USER [NT AUTHORITY\SYSTEM]; You will also need to grant the needed permissions on database objects to allow a minimally privileged user to access data. I suggest you do this via role membership to facilitate manageability: USE customdb; CREATE ROLE ...


1

Case 1: An extra table or database will eventually be pushed out of cache. It is harmless. Cure (but not worth doing): restart mysqld. Case 2: The 'system' is building thousands of tables and/or databases. Each table/database involves at least one entry in the containing OS directory. As this directory gets fuller, the OS operations to access files/...


1

Always outer join them, then just use a CASE statement to pick out the info from the relevant table: SELECT ref_id, case when p.property_id is null then p2.property_id else p.property_id end FROM invoices i left outer join properties p on i.ref_id = p.property_id left outer join properties2 p2 on i.ref_id = p2.property_id;


1

You should revise your table structure. You are trying to put too many different things into one table. What you could do is have multiple tables like so: Table: site Has an ID and all other details about the site! Table: Devices Has an ID and all other details about the device. Table: measurements Has an ID and all other details about the measurement....



Only top voted, non community-wiki answers of a minimum length are eligible