Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection

So I’m putting a plugin together that will allow me to connect multiple client sites with an online service.

I can get the service vendors snippet to load, but once you interact with it, that’s where things get tricky and it refuses to load an (I guess) iframe… …it’s pretty poorly documented.

Refused to load https://www.service-domain.com/ because it does not appear in the frame-ancestors directive of the Content Security Policy.

That’s the console log error I was receiving.

So I jumped back into my plugin and added the following:

function bbti_send_headers() {     header( "Content-Security-Policy: frame-ancestors https://www.service-domain.com/; frame-src https://www.service-domain.com/;" ); } add_action( 'send_headers', 'bbti_send_headers' ); 

Now, when I reload the page I’m still getting the same error Refused to load https://www.service-domain.com/... etc...

However, if I look at the network panel and check the page’s headers this is what I get:

HTTP/1.1 200 OK Content-Encoding: gzip Content-Security-Policy: frame-ancestors https://www.service-domain.com/; frame-src https://www.service-domain.com/; 

So the header is there but still getting the same error from the script.

Anyone know what it is I missed?

Response time optimization – Getting record count based on Input Parameters

I’m trying to optimize the process of calculating count of records, based on variable input parameters. The whole proces spans several queries, functions and stored procedures.

1/ Basically, front-end sends a request to the DB (it calls a Stored procedure) with an input parameter (DataTable). This DataTable (input parameter collection) contains 1 to X records. Each record corresponds to one specific rule.

2/ SP receives the collection of rules (as a custom typed table) and iterates through them one by one. Each rule apart from other meta-data contains a name of a specific function that should be used in evaluating the said rule.

For every rule, the SP prepares a dynamic query wherein it calls the mentioned function with 3 input parameters.

a/ Custom type Memory Optimized Table (Hashed index) b/ collection of lookup values (usually INTs) that the SELECT query uses to filtr data. Ie. "Get me all records, that have fkKey in (x1, x2, x3)" c/ BIT determining if this is the first rule in the whole process.

Each function has an IF statement, that determines based on the c/ parameter if it should return "all" records that fullfill the input criteria (b/). Or if it should fullfill the criteria on top of joining the result of previous rule that is contained in the custom table (a/)

3/ Once the function is run, it’s result is INSERTed into a table variable called @tmpResult. @result is then compared to tmpResult and records that are not in the tmpResult are DELETEd from result.

  • @result is a table variable (custom memory optimized table type), that holds intermediate result during the whole SP execution. It is fully filled up on the first rule, every consequent rule only removes records from it.

4/ The cycle repeats for every rule until all of the rules are done. At the end, count is called on the records in @result and returned as a result of SP.

Few things to take into account:

  • There are dozens of different types of rules. And the list of rules only grows bigger over time. That’s why dynamic query is used.
  • The most effective way to temporarily store records between individual rule execution so far proved to be custom Memory-Optimized table type. We tried a lot of things, but this one seems to be the fastest.
  • The number of records that are usually returned for 1 single rule is roughly somewhere between 100 000 and 3 000 000. That’s why a bucket_size of 5 000 000 for the HASHed temporary tables is used. And even though we tried nonclustered index, it was slower than that HASH.
  • The input collection of rules can vary strongly. There can be anything from 1 rule up to dozens of rules used at once.
  • Most every rules can be defined with at minimum 2 lookup values .. at most with dozens or in a few cases even hundred values. For a better understanding of rules, here are some examples:

Rule1Color, {1, 5, 7, 12} Rule2Size, {100, 200, 300} Rule3Material, {22, 23, 24}

Basically every rule is specified by it’s Designation, which corresponds to a specific Function. And by it’s collection of Lookup values. The possible lookup values differ based on the designation.

What we have done to optimize the process so far:

  • Where big number of records need to be temporarily stored, we use Memory-Optimized variable tables (also tried with temp ones, but it was basically same when using Memory-Optimized variants).
  • We strongly reduced and optimized the source tables the SELECT statements are run against.

Currently, the overal load is somewhat balanced 50/50 between I/O costs pertaining to SELECT statements and manipulation with records between temporary tables. Which is frankly not so good .. ideally the only bottleneck should be the I/O operations, but so far we were not able to come up with a better solution since the whole process has a lot of variability.

I will be happy for any idea you can throw my way. Of course feel free to ask questions if I failed to explain some part of the process adequately.

Thank you

I getting error when deploying the TableForm

vlabs = {0 -> "0", 1 -> "1", 2 -> "2"}; TableForm[{{"Java", RadioButtonBar[Dynamic[t1], vlabs]}, {"Pyhton",  RadioButtonBar[Dynamic[t2], vlabs]}, {"CSS",   RadioButtonBar[Dynamic[t3], vlabs]},   Button["Save",   DatabinAdd[   Databin["----"], {{"seher", {"java", t1}, {"pyhton", t2}, {"CSS",t3}}}]]}] 

When I run this code on the Worksheet It’s saving my datas to the databin. When I run this on the Worksheet It's saving my datas to the databin.

But however when I deploy it with CloudDeploy function and click the save button I see this page: enter image description here

What can be the problem? Can you help?

How can I narrate combat without it getting repetitive?

Although I mostly run D&D games I like to try and distract players from numbers as much as possible and keep the game narrative flowing at a smooth pace. For the most part, this is fine: lots of varied situations in the game call for dice rolls so I assess the situation, the level of success/failure and make something up on the spot.

When it comes to combat, however, I always find that there’s a limited stock of phrases that dry up very quickly because so many combat actions are the same. Even when there are spells involved the end result is very often injury to a participant. For the most part, it’s just a variation on "you swing your [weapon] and it [damages anatomy], causing your opponent [graphic injury]". There’s only so much you can do with this.

Even if you restrict this to criticals/fumbles/death blows there’s still easily enough of it to get very tiresome very fast.

Are there any ways I can try and vary combat narrative? Is it just my imagination that’s letting me down here?

Purging SP getting deadlocked with App…Not able to completed understand Deadlock Graph

We have a stored procedure which purges old data. On regular basis, it is getting deadlocked with application stored procedure. Below is the deadlock graph:

Deadlock Graph

Deadlock XML:

<deadlock>   <victim-list>    <victimProcess id="process1a780008c8"/>   </victim-list>   <process-list>    <process id="process1a780008c8" taskpriority="0" logused="1604" waitresource="KEY: 8:72065847945068544 (862c7d05dafc)" waittime="1477" ownerId="4649107786" transactionname="batch_archive" lasttranstarted="2020-12-18T22:05:16.377" XDES="0x27495e1c40" lockMode="U" schedulerid="6" kpid="7560" status="suspended" spid="1049" sbid="0" ecid="4" priority="0" trancount="0" lastbatchstarted="2020-12-18T22:05:01.070" lastbatchcompleted="2020-12-18T22:05:01.070" lastattention="1900-01-01T00:00:00.070" clientapp="SQLAgent - TSQL JobStep (Job 0xAC6E654BCA73184DA4769BFB133908A1 : Step 2)" hostname="SERVER_NAME" hostpid="4024" isolationlevel="read committed (2)" xactid="4649107786" currentdb="6" currentdbname="DB_NAME" lockTimeout="4294967295" clientoption1="673316896" clientoption2="128056">     <executionStack>      <frame procname="DB_NAME.dbo.PURGE_SP_NAME" line="674" stmtstart="45158" stmtend="45440" sqlhandle="0x03000600119b6e78797169003dab000001000000000000000000000000000000000000000000000000000000">  delete from DBNAME..TABLE_NAME with(rowlock) where email_id in      (select email_id from ARCHIVAL_BATCH    </frame>      <frame procname="adhoc" line="6" stmtstart="166" stmtend="566" sqlhandle="0x010006002208560560621cea2000000000000000000000000000000000000000000000000000000000000000">  EXEC @return_value = [dbo].[PURGE_SP_NAME]    @arch_mon_crit = 93,    @batch_size = 3,    @po_sql_code = @po_sql_code OUTPUT,    @po_sql_msg = @po_sql_msg OUTPU    </frame>     </executionStack>     <inputbuf>    DECLARE @return_value int,    @po_sql_code int,    @po_sql_msg nvarchar(2000)    EXEC @return_value = [dbo].[PURGE_SP_NAME]    @arch_mon_crit = 93,    @batch_size = 3,    @po_sql_code = @po_sql_code OUTPUT,    @po_sql_msg = @po_sql_msg OUTPUT    SELECT @po_sql_code as N&apos;@po_sql_code&apos;,    @po_sql_msg as N&apos;@po_sql_msg&apos;    SELECT &apos;Return Value&apos; = @return_value       </inputbuf>    </process>    <process id="process1a93ff7c28" taskpriority="0" logused="10000" waittime="1457" schedulerid="1" kpid="5312" status="suspended" spid="1049" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2020-12-18T22:05:01.070" lastbatchcompleted="2020-12-18T22:05:01.070" lastattention="1900-01-01T00:00:00.070" clientapp="SQLAgent - TSQL JobStep (Job 0xAC6E654BCA73184DA4769BFB133908A1 : Step 2)" hostname="SERVER_NAME" hostpid="4024" loginname="DOMAIN\SQL_SRVC_ACCOUNT" isolationlevel="read committed (2)" xactid="4649107786" currentdb="6" currentdbname="DB_NAME" lockTimeout="4294967295" clientoption1="673316896" clientoption2="128056">     <executionStack>      <frame procname="DB_NAME.dbo.PURGE_SP_NAME" line="674" stmtstart="45158" stmtend="45440" sqlhandle="0x03000600119b6e78797169003dab000001000000000000000000000000000000000000000000000000000000">  delete from DBNAME..TABLE_NAME with(rowlock) where email_id in      (select email_id from ARCHIVAL_BATCH    </frame>      <frame procname="adhoc" line="6" stmtstart="166" stmtend="566" sqlhandle="0x010006002208560560621cea2000000000000000000000000000000000000000000000000000000000000000">  EXEC @return_value = [dbo].[PURGE_SP_NAME]    @arch_mon_crit = 93,    @batch_size = 3,    @po_sql_code = @po_sql_code OUTPUT,    @po_sql_msg = @po_sql_msg OUTPU    </frame>     </executionStack>     <inputbuf>    DECLARE @return_value int,    @po_sql_code int,    @po_sql_msg nvarchar(2000)    EXEC @return_value = [dbo].[PURGE_SP_NAME]    @arch_mon_crit = 93,    @batch_size = 3,    @po_sql_code = @po_sql_code OUTPUT,    @po_sql_msg = @po_sql_msg OUTPUT    SELECT @po_sql_code as N&apos;@po_sql_code&apos;,    @po_sql_msg as N&apos;@po_sql_msg&apos;    SELECT &apos;Return Value&apos; = @return_value       </inputbuf>    </process>    <process id="process1a78191468" taskpriority="0" logused="21516" waitresource="OBJECT: 8:1761441349:4 " waittime="3632" ownerId="4649111643" transactionname="user_transaction" lasttranstarted="2020-12-18T22:05:19.960" XDES="0x208e1d4400" lockMode="IX" schedulerid="5" kpid="7936" status="suspended" spid="332" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2020-12-18T22:05:19.963" lastbatchcompleted="2020-12-18T22:05:19.547" lastattention="1900-01-01T00:00:00.547" clientapp="rx-process_jpid[8344]" hostname="APP_SERVER_NAME" hostpid="0" loginname="DOMAIN\SQL_SRVC_ACCOUNT" isolationlevel="read committed (2)" xactid="4649111643" currentdb="8" currentdbname="DBNAME" lockTimeout="4294967295" clientoption1="673185824" clientoption2="128056">     <executionStack>      <frame procname="DBNAME.dbo.APP_SERVER_NAME1" line="99" stmtstart="3616" stmtend="3868" sqlhandle="0x0300080011c5170b94ab5e01b0a8000001000000000000000000000000000000000000000000000000000000">  INSERT INTO TABLE_NAME_alt ( email_id ,activity_id ,text_content ) VALUES ( @p_email_id ,@p_activity_id ,@p_text_content    </frame>      <frame procname="DBNAME.dbo.APP_SERVER_NAME" line="301" stmtstart="14314" stmtend="15014" sqlhandle="0x0300080012f6881b97ab5e01b0a8000001000000000000000000000000000000000000000000000000000000">  EXEC @v_ret_value = APP_SERVER_NAME1 @p_email_id , @p_activity_id , @p_alias_id , @p_subject , @p_email_date , @p_email_size , @p_num_attachments , @p_charset , @p_message_id , @p_from_email_address , @p_recv_email_address , @p_delete_flag , @p_header , @p_content , @p_content_type , @p_text_content , @v_sql_code OUTPUT , @v_sql_message OUTPU    </frame>      <frame procname="adhoc" line="1" stmtstart="1204" stmtend="1900" sqlhandle="0x0100080051e7691ef0b8d2062300000000000000000000000000000000000000000000000000000000000000">  EXEC @P0 = APP_SP_NAME   @P1  ,  @P2  ,  @P3  ,  @P4  ,  @P5  ,  @P6  ,  @P7  ,  @P8  ,  @P9  ,  @P10  ,  @P11  , &apos;n&apos; , @P12  ,  @P13  ,  @P14  ,  @P15  ,  @P16  ,  @P17  ,  @P18  ,  @P19  ,  @P20 OUT  ,  @P21  ,  @P22  ,  @P23  ,  @P24  ,  @P25  ,  @P26  ,  @P27  ,  @P28  ,  @P29  ,  @P30  ,  @P31  ,  @P32  ,  @P33 OUT  ,  @P34 OU    </frame>      <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">  unknown    </frame>     </executionStack>     <inputbuf>  (@P0 decimal(38,4) OUTPUT,@P1 bigint,@P2 bigint,@P3 nvarchar(4000),@P4 datetime2,@P5 int,@P6 int,@P7 nvarchar(4000),@P8 nvarchar(4000),@P9 nvarchar(4000),@P10 nvarchar(4000),@P11 nvarchar(4000),@P12 nvarchar(4000),@P13 nvarchar(max),@P14 nvarchar(4000),@P15 nvarchar(4000),@P16 nvarchar(4000),@P17 nvarchar(4000),@P18 nvarchar(4000),@P19 nvarchar(4000),@P20 decimal(38,4) OUTPUT,@P21 int,@P22 int,@P23 bigint,@P24 bigint,@P25 nvarchar(4000),@P26 bigint,@P27 datetime2,@P28 int,@P29 nvarchar(4000),@P30 nvarchar(4000),@P31 nvarchar(4000),@P32 bigint,@P33 decimal(38,4) OUTPUT,@P34 nvarchar(4000) OUTPUT)EXEC @P0 = APP_SP_NAME   @P1  ,  @P2  ,  @P3  ,  @P4  ,  @P5  ,  @P6  ,  @P7  ,  @P8  ,  @P9  ,  @P10  ,  @P11  , &apos;n&apos; , @P12  ,  @P13  ,  @P14  ,  @P15  ,  @P16  ,  @P17  ,  @P18  ,  @P19  ,  @P20 OUT  ,  @P21  ,  @P22  ,  @P23  ,  @P24  ,  @P25  ,  @P26  ,  @P27  ,  @P28  ,  @P29  ,  @P30  ,  @P31  ,  @P32  ,  @P33 OUT  ,  @P34 OUT                                                                           </inputbuf>    </process>   </process-list>   <resource-list>    <keylock hobtid="72065847945068544" dbid="8" objectname="DBNAME.dbo.TABLE_NAME" indexname="TABLE_NAME_IDX" id="lock271c759a00" mode="X" associatedObjectId="72065847945068544">     <owner-list>      <owner id="process1a78191468" mode="X"/>     </owner-list>     <waiter-list>      <waiter id="process1a780008c8" mode="U" requestType="wait"/>     </waiter-list>    </keylock>    <exchangeEvent id="Pipe1d4b680400" WaitType="e_waitPipeGetRow" waiterType="Coordinator" nodeId="12" tid="0" ownerActivity="sentData" waiterActivity="needMoreData" merging="false" spilling="false" waitingToClose="false">     <owner-list>      <owner id="process1a780008c8"/>     </owner-list>     <waiter-list>      <waiter id="process1a93ff7c28"/>     </waiter-list>    </exchangeEvent>    <objectlock lockPartition="4" objid="1761441349" subresource="FULL" dbid="8" objectname="DBNAME.dbo.TABLE_NAME_ALT" id="lock23febd7300" mode="X" associatedObjectId="1761441349">     <owner-list>      <owner id="process1a93ff7c28" mode="X"/>     </owner-list>     <waiter-list>      <waiter id="process1a78191468" mode="IX" requestType="wait"/>     </waiter-list>    </objectlock>   </resource-list>  </deadlock>  

I have just started troubleshooting to fix deadlock. I am not able to get few things in above deadlock graph:

  1. Our Purging SP is a single SP which runs as one transaction, then why we are seeing two processes for it.
  2. What is exchange event? From where it came?
  3. At what level locks are being taken? Row, Page or table?
  4. How to proceed further?

Any help would be appreciated.

NOTE: 1. We are deleting less records batch wise in purging SP.
2. I have removed the actual SP and table Names with Aliases.

Getting catagory title total number of questions and answers order by number of questions

I have three tables. Which is in at this fiddle, http://sqlfiddle.com/#!9/46dfd6

Which is like this?.

CREATE TABLE `user_answers` (   `id` int(250) NOT NULL,   `question_id` varchar(250) NOT NULL,   `user_id` int(250) NOT NULL,   `answer` text NOT NULL,   `date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;  CREATE TABLE `user_questions` (   `id` varchar(250) NOT NULL,   `user_id` int(250) NOT NULL,   `note_id` int(250) NOT NULL,   `title` text NOT NULL,   `question` text NOT NULL,   `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=MyISAM DEFAULT CHARSET=latin1;  CREATE TABLE `material_univarcity_list` (   `id` int(100) NOT NULL,   `name` varchar(50) NOT NULL,   `about` mediumtext NOT NULL,   `date` date NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; 

I want to get a resultant table which has count – Name(Name is from material_univarcity_list) Total number of questions to that particular name. Here id of material_univarcity_list table is the note_id of user_questions and I want total number of answers to that particular catagory here question_id is the id of user_questions. How can I do this?

My expected result is like

no|catagory        |number_of_questions |number_of_answers  1|DBMS 5th sem ISE|            2       | 3 

How can i do this?

Getting meta in editor plugin, and event triggering issue

I have a Custom Post Type defined with custom-fields support. I then registered a meta field.

The first issue is that select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles always returns undefined on first call (before being updated by dispatch( 'core/editor' ).editPost). Also, when I save the Custom post Type the value isn’t modified in the database.

The other issue is, when check any of the checkboxes, on first click, isChecked() is properly called, on next clicks it doesn’t happen, but updateMeta() is triggered. If I fold/unfold the control or uncheck a checkbox, all the checkboxes do get updated by calling isChecked():

animation example of second issue

Here is my code:

class Metaboxes extends Base {      /**      * Setup user.      */     public function setup() {         add_action('init', [$  this, 'init'] );     }      public function init () {         register_post_meta(             'vaenc_actu',             '_vaenc_actu_roles_scope_roles',             [                 'show_in_rest' => true,                 'single'       => true,                 'type'         => 'array',                 'default'       => [],                 'auth_callback' => function() {                     return current_user_can( 'edit_posts' );                 }             ]         );     } } 

My javascript is like so:

const {registerPlugin}                              = wp.plugins; const {PluginDocumentSettingPanel}                  = wp.editPost; const {PanelBody, CheckboxControl}                  = wp.components; const {useSelect, select, withSelect, withDispatch} = wp.data; const {Fragment, useState}                          = wp.element; const {__}                                          = wp.i18n; const {compose}                                     = wp.compose;  const RolesControl = ( {isChecked, updateMeta} ) => {     return (         <>             <Fragment intialOpen={true}>                 <CheckboxControl                     label={__( "PRI", "vae" )}                     checked={isChecked( 'vae-pri' )}                     onChange={( value ) => updateMeta( 'vae-pri', value )}                 />                 <CheckboxControl                     label={__( "PRC", "vae" )}                     checked={isChecked( 'vae-prc' )}                     onChange={( value ) => updateMeta( 'vae-prc', value )}                 />                 <CheckboxControl                     label={__( "Certificateurs", "vae" )}                     checked={isChecked( 'vae-certif' )}                     onChange={( value ) => updateMeta( 'vae-certif', value )}                 />             </Fragment>         </>     ) }  const RolesField = compose( [     withSelect( () => {         return {             actu_scope_meta: select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles,         };     } ),     withDispatch( ( dispatch ) => ({         isChecked ( prop ) {             let meta = select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles;             if ( meta ) {                 return meta.includes( prop );             }             return false         },         updateMeta ( prop, value ) {             let meta = select( 'core/editor' ).getEditedPostAttribute( 'meta' )._vaenc_actu_roles_scope_roles;             if ( !meta ) meta = []              if ( meta.includes( prop ) && !value ) {                 meta = meta.filter( arrayItem => arrayItem !== prop );             } else if ( !meta.includes( prop ) ) {                 meta.push( prop );             }              dispatch( 'core/editor' ).editPost( {meta: {_vaenc_actu_roles_scope_roles: meta}} );         },     }) ), ] )( RolesControl );  const Render = () => {     const postType = useSelect( select => select( 'core/editor' ).getCurrentPostType() );     if ( 'vaenc_actu' !== postType ) {         return null;     }      return (         <>             <PluginDocumentSettingPanel                 name="vae-role-scope-sidebar"                 title={__( 'Restrictions', 'vae' )}             >                 <RolesField/>             </PluginDocumentSettingPanel>         </>     ) }  registerPlugin( 'vae-role-scope-sidebar', {     render: Render } )  

I will try to keep this as Adult as possible, but you are getting on my nerves

Post Closed as "Needs more focus" by Purple Monkey, John Dallman, Ifusaso, Oblivious Sage, Thomas Markov  

occurred 3 hours ago 2 Cleaning up. Trying to get the question to stay open.

edited 3 hours ago

Hey I Can Chan 176k1414 gold badges307307 silver badges745745 bronze badges

What’s the best Is there a way to convert MTG into creatures and characters to AD&D?

I started playing AD&D when it came out in the seventies. I have all of the 1st edition Core books including Deities & Demigods with Melnibonéan and Cthulhu mythos. I have about 100 Modules as well as some Gamma World and Star Frontiers. I started playing Magic the Gathering in 1993 and have about 15,000 cards. There are a lot of creatures as well as characters from the trading card game Magic: The Gathering that I would like to incorporate into some D&D dungeons, but not exactly sure how to make the transition from Magic’s Attack/Defense to D&D’s AC/HP or specific DAM into my Advanced Dungeons & Dragons campaigns. Any suggestions where to start? Is there a published process for such a conversion? If not, is there a comparison from tested homebrew conversion process that a user is willing from D&D share?

Two questions asked in posts and no answers, only posts closed. The Mods here must be kids that play nothing but 5e. I understand that it must be easier for you to just shut down a post, than to answer a question, or even just give some constructive criticism, but come on… This is by far the "crappiest" forum that I have ever had the displeasure of joining. I’m sure that you will close this post as well and possibly "Ban" me from posting again. but for Christ’s sake, answer a question once in a while or at least give some kind of feedback to help out someone that likes to share his interests with other gamers..

I have extra gold from the alternate way of getting starting equipment. What should I do with the extra money? [closed]

I was using the alternate way to get equipment in Chapter 5 of the PHB (D&D 5e) as a Fighter and rolled 160 GP, which I spent on Studded Leather Armor, a Longsword, the Explorer’s Pack, a Crossbow Bolt Case, a Light Crossbow, 20 Crossbow Bolts, and a Dagger, and still have 61 GP to spend on equipment. I have no idea what to do with the extra money as I’ve bought all the equipment I want. I don’t think the PHB addressed this and don’t know what the rules say. What is do the rules say on this?

Why am I getting this error: Incorrect syntax for definition of the table constraint

CREATE TABLE COMPUTER_ASSIGNMENT ( SerialNumber Int NOT NULL, EmployeeNumber Int NOT NULL, DateAssigned Date NOT NULL, DateReassigned Date NULL, CONSTRAINT SerialNumberPK PRIMARY KEY (SerialNumber, EmployeeNumber), REFERENCES COMPUTER (SerialNumber), CONSTRAINT SerialNumberFK FOREIGN KEY (SerialNumber, EmployeeNumber) REFERENCES EMPLOYEE (EmployeeNumber) );